478 B
478 B
Problem 5.4: Work queue of limited length using semaphores
Implement the work queue of limited length from problem 4.2 using semaphores as the only
synchronization mechanism, i.e. without synchronized
blocks or methods (and, consequentially,
not wait()
or notify()
). Test your program with your own semaphore class from problem 5.3 and
with java.util.concurrent.Semaphore
. Make sure not to use busy waiting: If a thread has
to wait, use semaphore operations for this.