Question: Multithreading C + + I am trying to make a simulation of behavior of customers ( patrons ) at a post office of up to

Multithreading C++
I am trying to make a simulation of behavior of customers (patrons) at a post office of up to 128 patrons at a post office. Each patron will arrive at the post office, wait for an available clerk, get the help they need, and leave the post office. Each patron will be represented by a separate thread created by a main program. This thread will synchronize with other threads to ensure that each patron will have exclusive access to one of the post office clerks. To achieve this, we must use Pthread mutexes and condition variables. SEMAPHORES NOT ALLOWED.
A txt file will be used to pass through the program.
Arnold 09
Bill 46
Carol 68
Dill 36
The program should print out a message every time a patron:
1. Arrives at the post office
2. Starts getting help
3. Leaves the post office
At the very end of the program, you should get a display that reads:
1. Total number of patrons served
2. Number of patrons that did not have to wait
3. The number of patrons that waited

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!