0

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?

  • Umm, http://en.wikipedia.org/wiki/Monitor_%28synchronization%29. – Oliver Charlesworth Jan 16 '13 at 01:23
  • @OliCharlesworth I've read it, but I need a precise meaning. the whole wiki article confuses me from what I've read so far.. makes a mess of things –  Jan 16 '13 at 01:25
  • What are you looking for (precisely) that isn't explained there already? (Or isn't covered by one of the external references it links to) – Oliver Charlesworth Jan 16 '13 at 01:28
  • @OliCharlesworth Mutual exclusion is used in Mutex. Wain and signal is used in semaphore. Wiki article combines both of these concepts into Monitors. But our professor stated that monitors are entirely different from the other two. –  Jan 16 '13 at 01:41

2 Answers2

1

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
ShowLove
  • 899
  • 1
  • 12
  • 21
0

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

Vishnu Vivek
  • 1,819
  • 1
  • 20
  • 30