
----- Original Message ----- From: "Johan Torp" <johan.torp@gmail.com> To: <boost@lists.boost.org> Sent: Tuesday, September 16, 2008 12:29 PM Subject: Re: [boost] [threadpool] relation with TR2 proposal
k-oli wrote:
2. How to employ work-stealing when one thread waits on a future Do you mean fork/join algorithm instead work-stealing?
Yes, you're right - it does not have anything to do with work-stealing per se. I mean that you want to intercept when a worker thread should have been blocked and process other tasks in the wait call:
void some_user_level_task() { ... some_future.wait(); // Do not really wait, execute other tasks using the same call stack ... }
Hi Johan, Should this behaviour be extended to other synchronization functions like mutex lock, condition wait, ... ? For this to work all these primitives must be wrapped, replacing the blocking primitives by the corresponding try_ primitives. In addition the threadpool should provide a one step scheduling on the *current* worker thread. What do you think? Vicente