Question
Solve this problem in Java Threads and Semaphores Design the following 2 things (1) a list of every semaphore, its purpose, and its initial value,
Solve this problem in Java
Threads and Semaphores
Design the following 2 things
(1) a list of every semaphore, its purpose, and its initial value,
(2) write pseudocode for each function. The pseudocode should be similar to the pseudocode shown in the textbook for the barbershop problem. Every wait and signal call must be included in the pseudocode.
Overview: The clinic to be simulated has doctors, each of which has their own nurse. Each doctor has an office of his or her own in which to visit patients. Patients will enter the clinic to see a doctor, which should be randomly assigned. Initially, a patient enters the waiting room and waits to register with the receptionist. Once registered, the patient sits in the waiting room until the nurse calls. The receptionist lets the nurse know a patient is waiting. The nurse directs the patient to the doctors office and tells the doctor that a patient is waiting. The doctor visits the patient and listens to the patients symptoms. The doctor advises the patient on the action to take. The patient then leaves. Threads://number of patient and doctors should be command line inputs
Receptionist one thread
Doctor one thread each, maximum of 3 doctors
Nurse one per doctor thread, identifier of doctor and corresponding nurse should match
Patient one thread each, up to 30 patients
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