Monitor

This lesson introduces the use of Monitor in Ruby.

We'll cover the following...

Monitor

We have discussed the general concept of a monitor in a previous lesson and now we'll see Ruby's implementation of a monitor. A monitor provides mutual exclusion and the ability for a thread to wait on one or more condition variables.

We can create a monitor as follows:

monitor = Monitor.new

For mutual exclusion, we can use instance methods ...