What is the difference between ManualResetEvent and AutoResetEvent in .NET? What is the difference between ManualResetEvent and AutoResetEvent in .NET? multithreading multithreading

What is the difference between ManualResetEvent and AutoResetEvent in .NET?


Yes. It's like the difference between a tollbooth and a door. The ManualResetEvent is the door, which needs to be closed (reset) manually. The AutoResetEvent is a tollbooth, allowing one car to go by and automatically closing before the next one can get through.


Just imagine that the AutoResetEvent executes WaitOne() and Reset() as a single atomic operation.


The short answer is yes. The most important difference is that an AutoResetEvent will only allow one single waiting thread to continue. A ManualResetEvent on the other hand will keep allowing threads, several at the same time even, to continue until you tell it to stop (Reset it).