3 Sep
2007
3 Sep
'07
2:11 p.m.
Hi: I'm having a bit of trouble with the implementation of the monitor pattern by means of using mutex and condition classes. I have a scheduler thread and a group of worker threads and the scheduling algorithm waits until some worker notifies that it has done the job. It seems that the call to condition::notify_one() must be in a specific order because if the worker calls notify_one before the scheduler arrives to the waiting line it behaves as if the condition object has lost the previous call to notify_one. Is this behavior the one we must expect? and, if so, can any one share a workaround. Thanks in advance. René