From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-05-14 05:59:37
----- Original Message -----
From: "Anthony Williams" <anthony_w.geo_at_[hidden]>
Sent: Wednesday, May 14, 2008 10:55 AM
Subject: Re: [boost] Review Request: future library (N2561/Williams version)
> "vicente.botet" <vicente.botet_at_[hidden]> writes:
>> Why you don't allow multiple callbacks? I suposse that this is related to
>> the implementation of do_callback
>> void do_callback(boost::unique_lock<boost::mutex>& lock)
>> if(callback && !done)
>> boost::function<void()> local_callback=callback;
>> relocker relock(lock);
>> You need to call all the callbacks with the mutex unlock, and you need to
>> protect from other concurrent set_wait_callback. So you will need to copy
>> the list of callbacks before unlock.
>> Is this correct?
> That is correct with respect to the implementation,
BTW, Braddock implementation do a move of the list of callbacks before doing
the callbacks. What do you thing about this approach?
> but I don't actually see
> the need for multiple callbacks. The callbacks are set as part of the
> or packaged_task. I can't imagine why that would require multiple
> callbacks. In any case, the user can provide that facility on their own if
What about the guarded schedule of Braddock?
schedule(boost::function<T (void)> const& fn, future<void> guard =
promise<T> prom; // create promise
return future<T>(prom); // return a future created from the promise
Several task can be scheduled guarded by the same future.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk