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

I/O thread Code optimization, reduces the number of OP_WRITE or OP_READ judgments #13184

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from
Open
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
16 changes: 10 additions & 6 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -4228,16 +4228,20 @@ void *IOThreadMain(void *myid) {
listIter li;
listNode *ln;
listRewind(io_threads_list[id],&li);
while((ln = listNext(&li))) {
client *c = listNodeValue(ln);
if (io_threads_op == IO_THREADS_OP_WRITE) {
if (io_threads_op == IO_THREADS_OP_WRITE) {
while((ln = listNext(&li))) {
client *c = listNodeValue(ln);
writeToClient(c,0);
} else if (io_threads_op == IO_THREADS_OP_READ) {
}
} else if (io_threads_op == IO_THREADS_OP_READ) {
while((ln = listNext(&li))) {
client *c = listNodeValue(ln);
readQueryFromClient(c->conn);
} else {
serverPanic("io_threads_op value is unknown");
}
} else {
serverPanic("io_threads_op value is unknown");
}

listEmpty(io_threads_list[id]);
setIOPendingCount(id, 0);
}
Expand Down
Loading