Home / Expert Answers / Computer Science / c-program-not-java-consider-a-system-with-three-chef-processes-and-one-agent-process-each-pa969

(Solved): -- C program -- not java.Consider a system with three chef processes and one agent process.Each ...



-- C program -- not java.

Consider a system with three chef processes and one agent process.

Each chef constantly cooks his recipe and then serves it. But cooking and serving food, the chef needs three items: cooking ingredients, Gas, and plates.

 One of the chef processes has cooking ingredients, another has Gas, and the third has plates. The agent has an infinite supply of all three materials. The agent places two of the items in the kitchen. The chef who has the remaining item then makes and serves it, signaling the agent on completion. The agent then puts out another two of the three items, and the cycle repeats.

 

Using semaphores, write a C program - under Linux – that solves the restaurant chef problem (based on process synchronization).

 

The Restaurant Chef Problem
Consider a system with three chef processes and one agent process.
Each chef constantly cooks his

The Restaurant Chef Problem Consider a system with three chef processes and one agent process. Each chef constantly cooks his recipe and then serves it. But cooking and serving food, the chef needs three items: cooking ingredients, Gas, and plates. One of the chef processes has cooking ingredients, another has Gas, and the third has plates. The agent has an infinite supply of all three materials. The agent places two of the items in the kitchen. The chef who has the remaining item then makes and serves it, signaling the agent on completion. The agent then puts out another two of the three items, and the cycle repeats. Using semaphores, - under Linux - that solves the restaurant chef problem (based on process synchronization).


We have an Answer from Expert

View Expert Answer

Expert Answer


How to run: -This program is run on eclipse and runs best on JavaSE-1.7 -Please make sure that all of the classes in the source code require pbj pack

We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe