CS3530_Assignment

advertisement
CS 3530 Operating Systems
Assignment _5
Deadlock
Study of Deadlocks with the Five Philosophers Problem. Observation of general behavior of a system
with deadlock situations and solutions. Computation of some relevant performance metrics.
There are four models implemented in C++ using Psim3 package:
"philos.cpp", "philos2.cpp", "philoshw.cpp", and "philoscw.cpp".
The first model always deadlocks.
The second model deadlocks sometimes.
The third model applies the disallowance of the hold and wait condition as a solution to deadlock.
The fourth model applies disallowance of the circular wait condition as a solution to deadlock.
Copy the model source C++ files from the system directory on CS3, then compile, and link to create the
executable program.
Run the program at least three times. Change the average parameter for the eating and thinking
intervals, and compare results. Make your changes by modifying the following value:
In file philos.cpp:
modify the eat_h and think_h fields
In file philos2.cpp:
modify the eat_h and think_h fields
In file philoshw.cpp: modify the mean_e[0] through mean_e[4] fields and the mean_th[0]
through mean_th[4] fields
In file philoscw.cpp: modify the mean_eat and mean_think fields
Write a report describing the characteristics of the operating system modeled. Use the usual guidelines
for structuring the report.
At the end of your report, include at the end of the report your answers to the following questions:
* What aspect of an operating system is the model representing?
* What performance measures does the model compute?
* What is noticeable in the dynamic behavior of the system?
* After changing some of the parameters in the model (the workload) and recompiling. What changes
in the results do you notice?
* What other performance measures can this model compute?
Download