Boost logo

Boost Users :

Subject: Re: [Boost-users] Concurrency and session termination in boost::asio
From: Boris (boriss_at_[hidden])
Date: 2008-11-06 11:47:00

On Thu, 06 Nov 2008 17:38:39 +0100, Scott Gifford
<sgifford_at_[hidden]> wrote:

> "Igor R" <boost.lists_at_[hidden]> writes:
>>> If those requests are scheduled on two different worker threads, they
>>> could execute
>>> simultaneously, and still cause problems.
>> Sorry, I forgot that you run one io_service in several threads... Why
>> wouldn't you scale your application using "io_service per CPU"
>> approach, rather than "thread per CPU"?
> At first glance, thread per CPU seemed simpler. Also I was planning
> on having my read callback handle some commands that may be slow, such
> as database queries, and I didn't want all other clients in the same
> io_service to block while that's happening. But certainly I can
> change that.

See for a
(small) discussion about the various designs. I wouldn't change the design
of an application though just because of difficulties in closing a socket.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at