Semaphore Demonstration
The program uses a classic Dijkstra semaphore (implemented using
Java monitors) to synchronise Thread A and Thread B. Thread A rotates
once before incrementing the semaphore (using up). Thread B rotates
a step every time it decrements the semaphore (using down).
View Source
Demo List