项目作者: sarojshakya01

项目描述 :
Candy Problem using Java Threading
高级语言: Java
项目地址: git://github.com/sarojshakya01/Java-Threading-Example1.git
创建时间: 2020-04-08T15:22:16Z
项目社区:https://github.com/sarojshakya01/Java-Threading-Example1

开源协议:

下载


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.