|
Boost : |
From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2005-12-15 13:03:32
Arkadiy Vertleyb wrote:
> "Peter Dimov" <pdimov_at_[hidden]> wrote
>
>
>>The "thread per connection" model _is_ inferior on all existing platforms.
>>If asio doesn't encourage its use, I consider this a feature.
>
>
> I am not sure what exactly the definition of "thread per connection" model
> is, but I assume this means a new thread is _created_ for every connection
> (?)
Right.
> What I did was to have the main thread accept incomming requests, and put
> them in the queue, whereas a number of worker threads was taking these
> requests from the queue, and execute them. I don't see how this model can
> be absolutely inferior in all possible contexts.
That is usually referred to as 'Thread Pool', and it is usually considered
the 'best' strategy among the multi-threaded ones, in particular due to its
scalability.
Regards,
Stefan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk