Can Pulse & Wait be used? Or is it evil and the reason for writing code?
If it sprinkles all the code that you really need to read, that could be a problem. Why does this occur so often in the first place? Could the functionality be encapsulated elsewhere?
In principle, there is nothing wrong with Wait / Pulse - but like everything else in life, if used inappropriately, it will become a problem. Whether your usage is inappropriate is hard to tell without seeing the code :(
source to share
I would really advise against this approach - from the MSDN page on PulseEvent:
A thread wait on a sync object can be temporarily removed from the wait state by using APC in kernel mode and then returned to the wait state after APC completes. If the PulseEvent is called during the time that the thread was removed from the wait state, the thread will not be released because the PulseEvent only releases the threads that are waiting at the moment it is called. Therefore, PulseEvent is unreliable and should not be used by new applications . Use variable conditions instead.
Now Monitor.Pulse can be written using something other than PulseEvent, but the whole concept is pretty flawed - use locks and condition variables correctly.
source to share