1
General Discussion about just::thread / Support for wait_for_any?
« on: January 01, 2012, 12:59:08 AM »
Hello
I realise that the C++11(?) standard probably does not include this facility, however the futures implementation in Boost.Thread has a "wait_for_any()" facility and I was wondering if just::thread's futures also supported something similar (ie am I missing something basic)?
Alternatively, are then any suggestions for rolling my own?? By which (of course) I am hoping for a concrete example
Right now, I have had to revert to the futures implementation in Boost.Thread although I still use just::thread for core thread support. Just some background: I have a pool of worker threads storage in a std::list< shared_ptr<task> > and I need the main thread to wait in case one of them explodes. Normal termination involves waking the main thread and actively stopping & join()ing the threads.
Happy New Year to all!
Kevin
I realise that the C++11(?) standard probably does not include this facility, however the futures implementation in Boost.Thread has a "wait_for_any()" facility and I was wondering if just::thread's futures also supported something similar (ie am I missing something basic)?
Alternatively, are then any suggestions for rolling my own?? By which (of course) I am hoping for a concrete example
Right now, I have had to revert to the futures implementation in Boost.Thread although I still use just::thread for core thread support. Just some background: I have a pool of worker threads storage in a std::list< shared_ptr<task> > and I need the main thread to wait in case one of them explodes. Normal termination involves waking the main thread and actively stopping & join()ing the threads.
Happy New Year to all!
Kevin