8 lines
573 B
Markdown
8 lines
573 B
Markdown
# Problem 5.3: Implement a semaphore in Java
|
||
|
||
Implement a Java class `Semaphor` with methods `p()` and `v() `as decribed in the lecture. Your class
|
||
should work for any number of threads using the same semaphore concurrently. Test your class using
|
||
the class `DiningPhilosophersWithForkAccessSema` (on the server in the source code folder
|
||
for chapter 4) by replacing all uses of `java.util.concurrent.Semaphore` by uses of your own
|
||
`Semaphor` class – the program's behavior should still be correct (though not identical, since the
|
||
output of the program is not determinate). |