Simulating CPU scheduling



next up previous
Next: Input Up: No Title Previous: Simulation

Simulating CPU scheduling

In order to simulate the scheduling of processes among CPUs, one would have to model things like which CPUs are currently in use and how many processes are waiting for a CPU. In other words, one would create variables to store this information. Things that have no effect on CPU scheduling, such as whether a particular process was generated by user a148pita or user a108zeme, need not be modelled.

The output from such a simulation would include statistics such as how long, on average, processes waited for a CPU. Input to the simulation would allow one to compare the system's performance in different situations. For instance, we might run the simulation with different numbers of CPUs so that we could determine how many CPUs are required in order for the average wait time to be within acceptable limits.

Attached to this handout are excerpts showing what a single run of such a simulation might look like.

Part A: Program



In this part of the assignment, you will complete a program that performs the sort of simulation described above. You may want to look at section 6.5 of the text, which contains a large example of a simulation program. Be aware that the textbook example uses pointers, and differs from our simulation in two major ways:



next up previous
Next: Input Up: No Title Previous: Simulation



Diane Horton
Mon Dec 11 15:56:16 EST 1995