diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2020-03-16 10:48:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-16 10:48:23 +0100 |
commit | f1e4af2c29d5520c69fe15e68145fa66bd01bdbd (patch) | |
tree | 2518d1d41181ae60419add26c18401398888fef1 | |
parent | 573c4673eec95ca7d92d1a47f1461c3621b15f90 (diff) | |
parent | c46c76a3991d769f3d8dff8d221555ac07981801 (diff) | |
download | redis-f1e4af2c29d5520c69fe15e68145fa66bd01bdbd.tar.gz |
Merge pull request #6993 from soloestoy/optimize-threaded-io
Threaded IO: handle pending reads clients ASAP after event loop
-rw-r--r-- | src/server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c index a6d4b357e..f702da94a 100644 --- a/src/server.c +++ b/src/server.c @@ -2088,6 +2088,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { void beforeSleep(struct aeEventLoop *eventLoop) { UNUSED(eventLoop); + /* We should handle pending reads clients ASAP after event loop. */ + handleClientsWithPendingReadsUsingThreads(); + /* Handle TLS pending data. (must be done before flushAppendOnlyFile) */ tlsProcessPendingData(); /* If tls still has pending unread data don't sleep at all. */ @@ -2157,7 +2160,6 @@ void beforeSleep(struct aeEventLoop *eventLoop) { void afterSleep(struct aeEventLoop *eventLoop) { UNUSED(eventLoop); if (moduleCount()) moduleAcquireGIL(); - handleClientsWithPendingReadsUsingThreads(); } /* =========================== Server initialization ======================== */ |