Each consumer waits until the buffer is full. In the case of producers only one is allowed to insert an item in the empty buffer. Other producers have to suspend until the item is consumed. The program in Figure 11.3 shows a single buffer monitor. Here we had to program a signaling mechanism for producers and consumers.
Most execution is done in an exclusive region.
If waiting is necessary it is done outside the exclusive region. This is done by using an auxiliary variable X , which gets bound to yes . This is done as an atomic step. In Oz, it is very rare to write programs in the monitor style shown above. In general it is very awkward.