Don’t understand the need for Monitor.Pulse()

You use Enter / Exit to acquire exclusive access to a lock.

You use Wait / Pulse to allow co-operative notification: I want to wait for something to occur, so I enter the lock and call Wait; the notifying code will enter the lock and call Pulse.

The two schemes are related, but they’re not trying to accomplish the same thing.

Consider how you’d implement a producer/consumer queue where the consumer can say “Wake me up when you’ve got an item for me to consume” without something like this.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)