Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A group of SCIT students drinks from a barrel that holds 5 0 servings of light beer. The SCIT students require a light beer to
A group of SCIT students drinks from a barrel that holds servings of light beer. The SCIT students require a light beer to think. Each student can take a flask from the barrel if it is not empty and then go away to think. If the barrel is empty, the student wakes up the bartender, who refills the barrel. An unsynchronised SCIT student thread continuously runs the pseudocode: while True: getserving drinkandthink Similarly, the bartender runs the unsynchronized code: while True: refillbarrel Any number of SCIT student threads can be running concurrently, but there is only one bartender thread. The synchronization problem has the following constraints: SCIT Students cannot get any light beer if the barrel is empty. The bartender can only refill the barrel when empty. Additionally, the bartender can only be awakened three times. Develop a solution incorporating two processes: SCIT student multithread and bartender. Ensure mutual exclusion, progress, and bounded wait to manage concurrent access to shared resources. Implement a simulation with the ability to pause and display the Process Control Block PCB for each thread. The displayed PCB should contain, at a minimum, the following details: Process ID Thread ID Thread State Refilling DrinkingThinking, Waiting, Terminated Process Type Student or Bartender Light beer required if student Light beer consumption if student Wake count if bartender The SCIT student process should consist of multithreaded threads in states of Waiting and DrinkingThinking. Submit a single source file written in java programming language executable within a Bash shell on a Linux system, ensuring the problem runs without errors. Your code should include comments to highlight project requirements. While developing the simulation solution, each group has the freedom to determine: synchronization requirements the amount of light beer each student wants to drink the time taken for students to think between drinks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started