EECS3321.3 Assignment 2. Using Threads. Due Date: Tue. July. 5 11:59midnight
EECS3321.3 Assignment 2. Using Threads. Due Date: Tue. July. 5 11:59midnight
3
Assignment 2.
Using Threads.
1
The program prints the following job statistics, one per line, properly annotated:
(1) Average waiting time (AWT)
(2) Average execution time (AXT)
(3) Average turnaround time (ATA)
(4) Average queue length (AQL)
(5) Average interarrival time. (AIA)
The command line options to the program are the --lambda [0.005], --mu [0.01],
--servers[2], --clients[2], --ticks[1000].
Your program will use pthreads. Every server, and every client will be separate
threads. In addition there is one thread for the clock and this can be the original thread. At
every tick of the clock thread, all other threads get activated, do whatever they need to do
and then wait for the next tick. Whenever the clock sees that all the threads have com-
pleted their work for the current tick, it emits the next tick. The program runs for the
number of ticks specified.