Boost logo

Boost Users :

From: Oleg Smolsky (oleg.smolsky_at_[hidden])
Date: 2006-02-13 20:26:32


Hello Matt,

Matt Schuckmann wrote on 3/02/2006 at 6:27 a.m.:
> This whole issue make me think that this problem could be much more
> easily solved with with a binary semaphore or a non recursive mutex.
> Then it doesn't matter if the worker thread gets done before the
> master thread starts to wait.
IMHO the model you are describing suits Win32 events a lot more than
condition variables. The issue is around "setting the condition prior
to somebody waiting on it", which, by definition, works well with
events. IE an event would remain signalled, until such time when
a thread decides to block on it. At that time, the thread just checks
the event and continues running.

Having said all that, the fact remains - win32 events don't exist on
unix/linux. However, events and the corresponding multiplexor
(WaitForMultipleObjects()) can be implemented using mutexes and
condition variables, thus making the the above model easy to program.

Best regards,
Oleg.


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