Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-05-12 08:01:05


Anthony Williams:

> One way to do this is have the pool use packaged_tasks internally, and set
> a
> wait callback which is invoked when a thread waits on a future from a pool
> task. When the callback is invoked by the waiting thread (as part of the
> call
> to wait()), if that waiting thread is a pool thread, it can proceed as
> above.

It actually doesn't matter whether the waiting thread is a pool thread or
not. If the task hasn't been scheduled, it can be "stolen" and executed
synchronously from within the wait().


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk