thread pool (block reading?)
I has great interest in ICE. Recently I has read the source code of threadpool.
I find Ice uses leader-follower thread model. There are some critical areas that only one thread can run and Ice uses the "_promote" to control it.
Only one thread runs function finished(handle) or message()(at the begin of those functions) can release the "_promote", and another thread can go into the critical area and to epoll other message. But before handler->message(), the thread should execute read(handler); in the function read(handler), the thread must read all bytes of the message, so my question is"If the connection is slow and message body is huge, the thread has to stop at here and the thread don‘t release the "_promote", and other threads have no chance to epoll new data(but can execute the code of object method) 。If the server has a lot of connections, i think it will be a bottleneck“
i'm sorry for my poor english.
|