Homework 5

Assigned: Mar. 18
Due: Mar. 25

Problem 1

Note: I STRONGLY recommend that anyone who did not do well on problem 6 of the midterm should work through this problem:

Consider the following scenario: There are three processes, A, B, and C. The OS is running a round-robin scheduler. At time 0, process A is is beginning to run and the FIFO ready queue holds {B,C} in that order. The time for a context switch is 2 msec. The activities of the three processes are as follows:

A will run a CPU burst of 20 msecs. It then blocks for an I/O call which will take 60 msec to complete. It then runs for a CPU burst of 40 msec. It then terminates.

B will run a CPU burst of 10 msecs. It then blocks for an I/O call which will take 80 msec to complete. It then runs for a CPU burst of 20 msec. It then terminates.

C will run a CPU burst of 25 msec. It then blocks for an I/O call which will take 40 msec to complete. It then runs for a CPU burst of 50 msec. It then terminates.

Note:

Trace the evolution of the system, and compute the CPU efficiency, from T=0 until all three processes are complete, under each of the following assumptions:

Problem 2

Suppose you have a multi-processing system using variable-length segments for memory management. The total size of memory is 128M. Jobs enter and exit the system as follows:
At time 0, Process A, of size 36M, enters.
At time 1, Process B, of size 70M, enters.
At time 2, Process A terminates.
At time 3, Process C, of size 15M, enters.
At time 4, Process D, of size 20M, enters.
At time 5, Process E, of size 20M, enters.
At time 6, Process F, of size 15M, enters.
At time 7, Process B terminates.
At time 8, Process G, of size 50M, enters.
At time 9, Process D terminates.
At time 10, Process F terminates.
At time 11, Process E terminates.
Trace the evolution of the system -- that is, the placement of each process in memory -- (a) if the "first fit" algorithm is used; (b) if the "best fit" algorithm is used. Assume that