Boost logo

Boost :

Subject: Re: [boost] [asio] Question regarding and pool of threads
From: Vivek Prakash (vivek.cs.iitr_at_[hidden])
Date: 2010-09-28 02:21:43

Since shared objects are safe( except when calling reset() prematurely), I
believe that there is no need to use a lock/semaphore.

Vivek Prakash

On Tue, Sep 28, 2010 at 8:48 AM, Romain CHANU <romainchanu_at_[hidden]> wrote:

> Hi,
> I was looking at this website where the guy gives an interesting example
> about the use of a pool of threads and
> However, something confuses me a bit, cf. the website "In just a bunch of
> lines of code we have a thread pool executing any arbitrary task whenever
> one thread is available. No need to address the usual multi-threading
> issues
> with concurrent jobs sharing few resources: just post what you need and let
> io_service take care of it!"
> Extracted from Boost Asio reference: "The
> io_service<
> >
> 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.
> Thank you.
> Regards,
> Romain
> _______________________________________________
> Unsubscribe & other changes:

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