Question: Java Problem : Consider a factory for cookies that has four production lines ( 1 . . 4 ) with different products. Each of the
Java Problem : Consider a factory for cookies that has four production lines with different products.
Each of the four lines produces a certain flavor cookie. Each one has a certain ingredient in stock as shown below:
line: flour, line: sugar, leine: butter, line: eggs,
The recipe for each line needs to have all four ingredients.
Therefore, each line needs three more ingredients to produce the different types of cookies in addition to their stock ingredient.
As an example, line has flour but it needs the ingredients: sugar, butter, and eggs. For line that needs to get flour, butter and eggs. The same goes for line and
The central line of the factory can provide randomly these ingredients as needed and notifies the line who needs these ingredients. When the line gets the ingredients produces the cookies and wait for the next ingredients to get from the central line.
Prepare a program that simulates this system using threads semaphores
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
