Monitor vs Mutex in c#

Ajay picture Ajay · Jul 22, 2009 · Viewed 67.7k times · Source

Possible Duplicate:
What are the differences between various threading synchronization options in C#?

What is the difference between a Monitor and a Mutex in C#?

When to use a Monitor and when to use a Mutex in C#?

Answer

Marc Gravell picture Marc Gravell · Jul 22, 2009

A Monitor is managed, and more lightweight - but is restricted to your AppDomain. A Mutex can be named, and can span processes (allowing some simple IPC scenarios between applications), and can be used in code that wants a wait-handle).

For most simple scenarios, Monitor (via lock) is fine.