https://github.com/sarojshakya01/java-threading-example1
Candy Problem using Java Threading
https://github.com/sarojshakya01/java-threading-example1
java-threads synchronized-methods
Last synced: 2 months ago
JSON representation
Candy Problem using Java Threading
- Host: GitHub
- URL: https://github.com/sarojshakya01/java-threading-example1
- Owner: sarojshakya01
- Created: 2020-04-08T15:22:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-25T09:13:15.000Z (over 4 years ago)
- Last Synced: 2025-02-08T08:34:52.887Z (11 months ago)
- Topics: java-threads, synchronized-methods
- Language: Java
- Size: 207 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# javathreading
Candy Problem using Java Threading
Java Synchronized class implementation for following scenario.
A group of N faculty members are sitting around a bowl of candy, which holds M pieces of candy. Each of the N faculty members spends his life thinking and eating candy. They must have a piece of candy to think. One TA spends his life sleeping except that when the bowl is empty he is woken up and fills the candy bowl. Only one faculty member can access the bowl at a time.