Boost logo

Boost :

Subject: Re: [boost] [asio] Question regarding and pool of threads
From: Romain CHANU (romainchanu_at_[hidden])
Date: 2010-09-28 21:45:17

Thanks guys for these answers.

I am looking at the strand facility right now.

I will do some testing and see if I can come up with something working :-)

Any good examples to suggest?

The one in
using strand but there was no real need for it.

On 28 September 2010 17:29, Tan, Tom (Shanghai) <TTan_at_[hidden]> wrote:

> -----Original Message-----
> Date: Tue, 28 Sep 2010 11:18:22 +0800
> From: Romain CHANU <romainchanu_at_[hidden]>
> To: boost_at_[hidden]
> Subject: [boost] [asio] Question regarding and pool
> of threads
> >
> >Extracted from Boost Asio reference: "The
> >io_service<
> >erence/io_service.html>
> >guarantees
> >that the handler will only be called in a thread in which the run(),
> >run_one (), poll() or poll_one() member functions is currently being
> invoked."
> >
> >For my understanding, since there is a pool of threads, a handler can
> >run concurrently in different threads, even though we are using
> >
> >
> >Is that correct? My concern here is about the need or not to lock the
> >data accessed by the handler.
> >
> My understanding is that, it's another way to say that those calls won't
> create an additional thread while calling the completion handler having
> been registered by Therefore, if
> itself is running in n threads, it's guaranteed all the registered
> completion handler will be invoked in at most n threads at random order,
> since there are only n threads in total .
> -Tom
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at