
----- Original Message ----- From: "Oliver Kowalke" <k-oli@gmx.de> To: <boost@lists.boost.org> Sent: Wednesday, November 05, 2008 10:04 AM Subject: Re: [boost] [threadpool] mixture of recursive invokation and fibers?
What is the advantage to have one pool for each stage respect one pool for all the stages?
Imagine we have stage A which reads message from the network and stage B processing the messages read by A. If both use the same threadpool and mltiple clients send a large messages (ready will take some significant time) stage A coul possibly allocate all threads in the pool so not work-item in stage B can be executed. If both stages use different pools the processing of work-items is independent. B can executes its task even if stage A becomes a high load.
Why the A would allocate all the the threads in the pool? If the stage A handle a message and the request B to do somthing the task of B will be enqueued before other new messages comming from the network, so B will be interleaved with A. What I'm missing? Best, Vicente