Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some synchronization that seems no longer necessary #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/client/TCPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ TCPClient::~TCPClient() {

if (sender_thread) {
LOG<INFO>("Terminating sender thread");
queue_semaphore.signal(); // unblock sender thread
sender_thread->join();
delete sender_thread;
}
Expand Down Expand Up @@ -602,8 +601,6 @@ ssize_t TCPClient::read_all(int sock, void* data, size_t len) {
void TCPClient::process_send() {
// Wait until there are messages to send
while (1) {
queue_semaphore.wait();

if (terminate_threads) {
return;
}
Expand Down Expand Up @@ -644,9 +641,6 @@ void TCPClient::process_send() {
#endif
LOG<INFO>("message pair sent by client");

// Release the lock so that the other thread may add to the send queue
queue_lock.signal();

// Add the builder to the queue if it is of the right type (a write)
// And if not over capacity
reuse_lock.wait();
Expand Down Expand Up @@ -693,11 +687,6 @@ BladeClient::ClientFuture TCPClient::enqueue_message(

#ifdef PERF_LOG
TimerFunction sem_time;
#endif
// Alert that the queue has been updated
queue_semaphore.signal();

#ifdef PERF_LOG
LOG<PERF>("TCPClient::enqueue_message semaphore signal time (us): ",
sem_time.getUsElapsed());
#endif
Expand Down
4 changes: 0 additions & 4 deletions src/client/TCPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,8 @@ class TCPClient : public BladeClient {

/** Lock on the txn_map. */
cirrus::SpinLock map_lock;
/** Lock on the send_queue. */
cirrus::SpinLock queue_lock;
/** Lock on the reuse_queue. */
cirrus::SpinLock reuse_lock;
/** Semaphore for the send_queue. */
cirrus::PosixSemaphore queue_semaphore;
/** Thread that runs the receiving loop. */
std::thread* receiver_thread = nullptr;
/** Thread that runs the sending loop. */
Expand Down