Boost logo

Boost :

Subject: Re: [boost] [threadpool] relation with TR2 proposal
From: Johan Torp (johan.torp_at_[hidden])
Date: 2008-09-16 06:29:04


k-oli wrote:
>
> Am Dienstag, 16. September 2008 11:49:49 schrieb Johan Torp:
>> There are at least two things which still needs be solved:
>> 1. How to wait for multiple futures
>
> Braddocks future lib provides support logical ops for futures:
>
> future< int > f1 = ...
> future< string > f2 = ...
> future< void > f3 = op( f1) && op( f2);
> f3.wait(); // waits for f1 and f2
>

Yes, but it is implemented in terms of a public callback. IMHO, this is
_really_ dangerous.

k-oli wrote:
>
>> 2. How to employ work-stealing when one thread waits on a future
> Do you mean fork/join algorithm instead work-stealing?
>

Yes, you're right - it does not have anything to do with work-stealing per
se.
I mean that you want to intercept when a worker thread should have been
blocked and process other tasks in the wait call:

void some_user_level_task() {
...
  some_future.wait(); // Do not really wait, execute other tasks using the
same call stack
...
}

Johan

-- 
View this message in context: http://www.nabble.com/-threadpool--relation-with-TR2-proposal-tp19452045p19509153.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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