Monitor.Wait and Monitor.Enter
What's difference between two method? Monitor.Wait() and Monitor.Enter().Can you help me?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
abdus salam8 reputationPosted May 22, 2007, 11:46 PM EDT
Monitor.Wait Releases the lock on an object in order to permit other threads to lock and access the object. The calling thread waits while another thread accesses the object. Pulse signals are used to notify waiting threads about changes to an object's state.
Posted Oct 15, 2007, 1:44 AM EDT
the object
Monitor.Wait
[When a thread calls Wait, it releases the lock on the object and enters the
object's waiting queue.
The thread that currently owns the lock on the specified object invokes this
method in order to release the object so that another thread can access it.
The caller is blocked while waiting to reacquire the lock. This method is
called when the caller is waiting for a change in the state of the object
that will occur as a result of another thread's operations on the object.]
AutoResetEvent is used for thread communication via signals. Flavor of
AutoResetEvent is that you have not to call Reset.