Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f1e4af2c
Unverified
Commit
f1e4af2c
authored
Mar 16, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 16, 2020
Browse files
Merge pull request #6993 from soloestoy/optimize-threaded-io
Threaded IO: handle pending reads clients ASAP after event loop
parents
573c4673
c46c76a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
f1e4af2c
...
...
@@ -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 ======================== */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment