Multithread Application: Simulation of a Pizza Cafe with Synchronization
2 Pages606 Words131 Views
About This Document
Simulate a pizza cafe with a chef and multiple customers using multithreading in a synchronized manner. The program stops when all customers finish eating their pizzas and no pizza is left in the kitchen. The number of customers, unsold pizzas, and seats are input by the user. Each customer buys one pizza and eats for a random time between 1 to 10 time units. The chef takes 5 time units to make a pizza and only makes enough pizzas for all customers. The output shows the arrival of customers, chef making pizzas, customers buying pizzas, customers getting seats, and customers leaving after eating.