Use of mointer in C#
How to use Monitor in C#.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niravkumar VaghelaPosted Jul 26, 2012, 6:25 AM
In thread synchronization, we need to manage threds action to get expacted output. Synchronization plays important role when two threads access same data.
Monitor objects expose the ability to synchronize access to a region of code by taking and releasing a lock on a particular object using the Monitor.Enter, Monitor.TryEnter, and Monitor.Exit methods. Once you have a lock on a code region, you can use the Monitor.Wait, Monitor.Pulse, and Monitor.PulseAll methods. Wait releases the lock if it is held and waits to be notified. When Wait is notified, it returns and obtains the lock again. Both Pulse and PulseAll signal for the next thread in the wait queue to proceed.
Please refre following link:
http://msdn.microsoft.com/en-us/library/hf5de04k.aspx
Hope this will help you.
VulpesPosted Jul 26, 2012, 5:44 AM
http://msdn.microsoft.com/en-us/library/system.threading.monitor.aspx