What is the purpose of ManualResetEvent in .NET?

.NET supports two synchronization classes namely ManualResetEvent and AutoResetEvent. ManualResetEvent belongs to System.Threading namespace. This class establishes communication within threads. This communication is achieved by signaling.




Each instance of this class will have a status which can either be signaled or nonsignaled. This status field indicates whether the thread can continue with execution or not. If it is in signaled state, then the thread can begin its execution. If its status is set to nonsignaled, then the thread is blocked. It has to wait until it receives the indication through which its status goes back to ‘signaled’.

Signaling is done using the following means:

• You can call Set method to set status of its instance to signaled.
• You can call Reset method to set status of its instance to nonsignaled. This status change can also be achieved if the control reaches a call to WaitOne.

_______________________________________________________________________

Add to My Yahoo!


FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

Visit .NET Programming Tutorial Homepage

______________________________________________________

Recommended Resource

| What is Private Access Modifier in C#? | What is Protected Access Modifier in C#? | What is Protected Internal Access Modifier in C#? | What is Public Access Modifier in C#? | What is the difference between virtual and abstract keywords in .NET? | What is the importance of Microsoft Application Blocks in .NET Architecture? | What is the need for Factory Method in C# | What is the purpose of ArrayList in .NET? | What is the purpose of Datareader in ADO.NET? | What is the purpose of Dataset in ADO.NET? | What is the purpose of finally block in C#? | What is the purpose of interlocked class in .NET? | What is the purpose of main() function in C# | What is the purpose of ManualResetEvent in .NET? | What is the purpose of sealed method in C#? | What is the purpose of Thread.Join() method in .NET? | What is the purpose of Thread.Sleep() method in .NET? | What is the purpose of throw keyword in C#? | What is the usage of ENUM in .NET? |


| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2017 - All Rights Reserved.