
3 Feb
2009
3 Feb
'09
11:29 a.m.
but I don't know for what there is pool of threads in "http server 3" example. there is only one scheduled task - async_accept. So, in my opinion only one thread will be doing whole job.
First of all, there're more tasks: pay attention that before issuing new async_accept, the Server calls connection->open(), which in turn issues async_read etc - all this is processed by one single io_service... But anyway - what if you've got 1000 incoming connections simultaniously? If you'd got 1 thread, it would accept them one by one, processing in the meanwhile read/write operations of the Connection object.