## Problem Set 2

Assigned: Jan. 29
Due: Feb. 5

Consider the following processes (same as problem 1).

• Process A executes for 10 msec, blocks for 60 msec, executes for 60 msec, and terminates.
• Process B executes for 70 msec, blocks for 50 msec, executes for 20 msec, and terminates.
• Process C executes for 60 msec, blocks for 60 msec, executes for 40 msec, and terminates.
• Process D executes for 20 msec, blocks for 50 msec, executes for 10 msec, and terminates.
• Process E executes for 80 msec and terminates.
Processes enter the system under the following schedule:
D enters at time 0.
E enters at time 1.
B enters at time 2.
A enters at time 5.
C enters at time 10.

Trace the evolution of the system under the following scheduling algorithms:

• First come first served.
• Shortest job first
• Preemptive shortest job first.
• Non-preemptive shortest job first with aging. Set the "anti-priority" for job J in the ready queue to be (the length of the next CPU burst for J) minus one-half (the length of time that J has been ready). Choose the job with the lowest anti-priority.
You do not have to show the memory management, just the scheduling.

Note: the length of "job" considered in these algorithm is the time of the current CPU burst, not the time for the entire job.

In any of these algorithm, if job P unblocks at the same time that job Q blocks, the scheduling algorithm should consider P as a possible candidate to replace Q. That is, you should first deal with P unblocking and then run the scheduling algorithm.