Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Thread] Multithreaded Multithreaded Server (Ian Mallett)
From: Marat Abrarov (abrarov_at_[hidden])
Date: 2011-04-11 06:07:15


> Hi,
>
> Fairly new to Boost. Bear with me.
>
> I'm trying to write a multithreaded multithreaded server (two multithreaded
> operations): ideally, there should be a single process, containing at least two threads. The first
> thread handles various tasks (and can start other threads to help it as well). The other thread waits
> for incoming connections, and adds a new thread for each one:

http://sourceforge.net/projects/asio-samples/
Look at projects "echo_server" and "qt_echo_server".

They use 2 thread pools among main (GUI) thread.
One thread pool (size is 1-2 threads) executes session management loop:
acceptance (with limited number of active sessions), start of accepted session, end of all sessions.
Second thread pool (by default is CPU number bounded) executes sessions' loops:
start of asynchronous read, start of asynchronous write, IO operation completion handling.
 
Regards,
Marat Abrarov.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net