From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2007-10-31 10:13:48
Has there been any development with regards to a working, portable
Boost.Thread based Thread Pool library?
Personally I've been using the following sample idiom for achieving
what a thread pool is supposed to be accomplishing -- and I'm
wondering (aloud) whether there are any existing implementations out
there that rely solely on Boost.Thread. Currently, the following code
snippet requires Boost.Asio, but I'm not sure if there's something
that may be distilled from the recurring pattern below:
using namespace boost::asio;
using namespace boost;
shared_ptr<io_service::work> sentinel(new io_service::work(process_queue));
for(unsigned int spawn_counter = THREAD_COUNT;
spawn_counter > 0;
// add all void nullary functors and post them here
// once all the work has been queued, remove the sentinel
Will something like this be useful as a utility library? Insights,
pointers, and suggestions would be very much appreciated.
Have a great day everyone!
-- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis_at_[hidden]] [+63 928 7291459] [+1 408 4049523]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk