
9 Oct
2006
9 Oct
'06
6:39 p.m.
Alexander Terekhov wrote:
Threads A and B waiting (A does timed wait), C changes something, signals and enters wait expecting another state change followed by signaling from either A or B (whichever gets the signal and makes processing). If A times out and only re-signal, that signal can be consumed by C as spurious wake. So broadcast() is needed to wake B and let it do the job.
This can only happen if C is waiting on the same condition variable, isn't it? Then I would expect it is waiting on the inverted predicate to be meaningful (e.g. consumer/producer). So this is just a special case of a condition sharing multiple predicates, right? Roland