Search code examples
synchronizationoperating-systemtheorycritical-section

Importance of Critical region and Monitors as Synchronization mechanism


I read in many text books that critical region and monitors are high-level language mechanisms to provide synchronization mechanism.

I couldn't find a simpler explanation about these in any text. I have some doubts on these.

How compiler actually implements these?

Whether these things are available in C, Java, Python . . ?

What is the importance of conditional constructs in monitors and critical region (conditional critical region)


Solution

  • In java, monitors are a built-in element of the language. They are accessed by the synchronized keyword, and have several functions related to them (such as wait()). You can google it to find out more about it.

    Regarding how it is implemented, There are several algorithms that implement monitors, with different pros and cons. If you are interested in this, allow me to recommend Herlihy and Shavit's book - the art of multiprocessor programming.