|
Boost : |
From: John Maddock (john_at_[hidden])
Date: 2008-05-16 04:54:03
With apologies for coming to the discussion late, it seems to me that many
future implementations including the ones under discussion are high level
interfaces that are "feature rich". Nothing wrong with that, it's exactly
what a lot of folks need.
But I would also be interested in a super-lightweight future used for more
low-level task-based parrallelism. In my dreams <g>, it would be something
like:
* Create a scoped object that executes the "future" in parrallel,
constructing the object would be no more expensive than a trivial function
call - so no memory allocation or mutexes allowed, only lock-free
programming.
* The future would be executed using a thread drawn from a pool - or
possibly a local team - so there's no thread creation overhead either
(except at program startup, or possibly the first time a future is invoked).
* At a later point in the same scope, join with the future, again this
should be a "trivial" lock-free operation if the future has completed.
So... is such a beast possible? Or are threads actually too heavyweight for
such usage?
Hopefully yours, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk