[QUESTION] redis threaded io polling mode
lorneli opened this issue · comments
It looks like redis implements threaded io in polling mode. IO thread loops in while(1) way. At the beginning of each loop, it calls getIOPendingCount 1000000 times(or less times if pending_count != 0). So, io thread is basically implemented in polling mode, which costs much cpu wasting.
Another possible implementation is to wake up(condition notify) io thread when main thread finds out there are waiting clients. IO thread handles clients read/write and blocks on the condition variable.
I wonder if there was more consideration about current polling mode implement. Thanks.