Commit 8fe25edc authored by antirez's avatar antirez
Browse files

Save a call to stopThreadedIOIfNeeded() for the base case.

Probably no performance changes, but the code should be trivial to
read as in "No threading? Use the normal function and return".
parent 17dfd7ca
...@@ -2997,9 +2997,9 @@ int handleClientsWithPendingWritesUsingThreads(void) { ...@@ -2997,9 +2997,9 @@ int handleClientsWithPendingWritesUsingThreads(void) {
int processed = listLength(server.clients_pending_write); int processed = listLength(server.clients_pending_write);
if (processed == 0) return 0; /* Return ASAP if there are no clients. */ if (processed == 0) return 0; /* Return ASAP if there are no clients. */
/* If we have just a few clients to serve, don't use I/O threads, but the /* If I/O threads are disabled or we have few clients to serve, don't
* boring synchronous code. */ * use I/O threads, but thejboring synchronous code. */
if (stopThreadedIOIfNeeded()) { if (server.io_threads_num == 1 || stopThreadedIOIfNeeded()) {
return handleClientsWithPendingWrites(); return handleClientsWithPendingWrites();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment