Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

manual reset event, Auto reset event

Tags:

c#

In C# what is the difference between manual reset event, autoresetevent. Also when should one use the same. What is difference between setting autoresetevent to true or false.

like image 706
Prashant Avatar asked Jan 19 '10 10:01

Prashant


1 Answers

For the ManualResetEvent, once you've called Set(), you have to deliberately call Reset() to put it back in an unsignaled state such that calls to WaitOne() will block.

This is not necessary for AutoResetEvent.

The documentation is pretty good on MSDN for ManualResetEvent and AutoResetEvent.

like image 64
Neil Barnwell Avatar answered Nov 15 '22 17:11

Neil Barnwell