From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-12-15 15:03:48
On Thu, 15 Dec 2005 13:41:32 -0600
Thore Karlsen <sid_at_[hidden]> wrote:
> You seem to be reading this differently than I am. To me it looks like
> he's saying that he has one thread that accepts connections, and then
> he passes the socket to a worker thread where he does all the
> synchronous reading and writing to service the client.
> He may have the threads already standing by when he accepts new
> connections, but since he's doing synchronous I/O he can't service
> more than one connection at a time from a thread. Thus the number of
> connections he can handle is limited by the number of threads he has,
> which is why there's a scalability problem.
You do not understand. This is a typical technique for thread pools.
Each thread only performs the task requested, and the next task may be
on a totally different connection.
The number of connections is only limited by the operating system. The
number of connections that can be serviced "simultaneously" is limited
by the number of threads in the thread pool (please note the quotes
around simultaneously -- I am fully aware of the actualities).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk