Concurrent Programming with Java
Lab Manual, Version 1.0, F. Astha Ekadiyanto, 2002.

[Contents] [Next] [Previous]

Lab 5: Monitors and Thread Synchronization 1


Thread Monitor Demonstration

All the codes and materials in this section are taken from http://www.hta-be.bfh.ch/~fischli/kurse/threads/monitor/index.html.

In the previous page, you may notice some new keywords such as synchronized, wait(), and notifyAll() (or notify()).
These can be observed in the State Diagram Below.


The figure below shows an example of how this Demonstration looks like.
Once you have figured out how these work, you might be able to solve the Problem in the Race Condition section.

First of all create a new BlueJ Project called MonitorDemo and then implement the codes:


[Contents] [Next] [Previous]