Boost logo

Boost :

Subject: Re: [boost] Futures Review - fork_after
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2009-01-18 15:52:29


Hi,

I have add the fork_after function to Boost.InterThreads. The prototype allows to execute asynchronously N functions and execute asynchronously a function that depends on the completion of N functions.

    bith::shared_launcher ae;
    BOOST_AUTO(actT, bith::fork_all(ae, fct1, fct2));
    BOOST_AUTO(act,bith::fork_after(ae, fct3, actT));
    act.wait();

bith::shared_launcher is an asynchronous executor (AE) that executes asynchronously a function on a new thread.

bith::fork_all request the AE to execute asynchronously each function. It returns a fusion tuple of the asynchronous completion token (ACT) associated the the ae.

bith::fork_after request the AE to execute a function asynchronously once each one of ACTs in the dependency tuple parameter are ready. It is similar to the async_with_dependencies proposed Peter Dimov.

I have used for that Boost.Future (Anthony proposal).

Is there any interest in this kind of feautres?

Best,
Vicente


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