They both seem to fulfill the same purpose. When would I chose one over the other?
.net – When would I use AutoResetEvent and ManualResetEvent instead of Monitor.Wait()/Monitor.Pulse()
lockingmultithreadingnetsynchronization
Related Topic
- C# – the difference between ManualResetEvent and AutoResetEvent in .NET
- The difference between a process and a thread
- .net – Array versus List
: When to use which - .net – Difference between decimal, float and double in .NET
- C# – When to use .First and when to use .FirstOrDefault with LINQ
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C# – What does a lock statement do under the hood
- C# – How and when to use ‘async’ and ‘await’
Best Answer
Use the events when you've got a thread that is waiting on one of or all of a number of events to do something.
Use the monitor if you want to restrict access to a data structure by limiting how many threads can access it.
Monitors usually protect a resource, whereas events tell you something's happening, like the application shutting down.
Also, events can be named (see the OpenExisting method), this allows them to be used for synchronization across different processes.