
17 Jun
2009
17 Jun
'09
6:11 p.m.
Cosimo Calabrese wrote:
Is there a way to unlock all the producers with the boost::interprocess::semaphore? Or I have mistaken the approach of the problem?
A semaphore post only increases a waiting thread if count was 0. That's the behaviour of a semaphore. If you want to wake up all waiters, use a condition variable and notify_all. Take any mutex condition variable tutorial for an example on multiple producers / consumers.
Thanks to all, Cosimo Calabrese.
Ion