문제

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