There are lots of information in the internet for Semaphore, Mutex, etc. But as far as I've searched, there isn't a clear info available on Monitors.

I know that a Mutex helps in Mutual exclusion between processes. A binary semaphore also does similar function. Then what is the use of introducing a new concept called Monitor?

有帮助吗?

解决方案 2

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).

其他提示

From my operating system notes I understood it in the following way. I would start by understanding an Object, which is an abstract data type.

An abstract data type—or ADT—encapsulates data with a set of functions to operate on that data that are independent of any specific implementation of the ADT.

A monitor type is an ADT that includes a set of programmer defined operations that are provided with mutual exclusion within the monitor.A monitor is almost equivalent to an object that encapsulates data with two exceptions.

  • Only one function of a monitor can execute at a time A thread that is
  • waiting on a condition variable does not occupy the monitor
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top