parallele-programmierung/u05-3/README.md

8 lines
573 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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).