Boost logo

Boost Users :

Subject: [Boost-users] Using boost::barrier
From: Asheh (ashley.canning_at_[hidden])
Date: 2009-02-21 11:33:54


Hi, Having trouble with sleeping N threads while I need to wake them. Since
boost contains no sleep/wake functionality I have tried using
boost::condition, I have had trouble with this too (it seems to cause
locks). Somone mentioned boost::barrier I read about it in the documentation
and it appears to function in a way I would require, here is what im looking
for:

I reach a point in the program where I segment a pieces of data and it needs
to be processed in parallel on two threads, the main thread waits for the
two worker threads to finish processing then continues on, those two threads
(or N threads..) must then go back to sleep until they are needed again.

Can anyone provide a good solution, if boost::barrier is what im looking for
could you help me describe how Id correctly impliment this?

Thanks
Ashley.

-- 
View this message in context: http://www.nabble.com/Using-boost%3A%3Abarrier-tp22137821p22137821.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net