Subject: [boost] [interthreads] Library under development v0.2
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2009-01-14 13:49:51
I have added the threader/joiner classes following the design of Kevlin Henney N1833 - Preliminary Threading Library Proposal for TR2 (http:/www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1883.pdf).
I use the Boost.Futures library from Anthony (review ongoing)
In addition and as a generalization of these classes I have started a framework working with asynchronous executors -AE (threader) and asynchronous completion tokens -ACT (joiner).
The library include also an launcher (AE) associated to the unique_future (ACT) which is the equivalent of the thread_pool in N2276 - Thread Pools and Futures (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2276.html)
With some minor changes in the ThreadPool library (review scheduled), the tp:pool can be seen as a AE and the tp::task as a ACT.
The library allows also to fork several functions at the same time. The result of the fork_all operation is a fusion tuple of asynchronous completion token handles. The user can apply any fusion algorithm on this tuple as for example. To make common tasks easier the library provide some functors and some functions that are the result of applying these functors to the tuple using a fusion algorithm.
Last the library provides also some functions like wait_for_all that forks all the functions and wait for the result of all of them and wait_for_any which works with functions that return the same type, and forks all the functions and wait for the first one.
For the moment the AE/ACT framework is included it in Bosst.InterThreads library, but this is independent and can be included in an independent library (any suggestion for a name and a namespace?)
The library is available at
Boost Sandbox: https://svn.boost.org/svn/boost/sandbox/interthreads
Boost Vault: http://www.boostpro.com/vault/index.php?action=downloadfile&filename=interthreads.zip&directory=Concurrent%20Programming&
Includes every thing on the Sandbox + Html documentation + Boost.Futures + Boost.ThreadPool adaptations
I'd appreciate it if people could take a look, test it on their compiler and give me some feedback.
It's not quite ready for formal review yet.
Vicente Juan Botet Escribá
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk