COP4610 Spring 2006 Homework Assignment 3
The material for this homework assignment covers Chapters 5 to 7.
1. Which of the scheduling algorithms FCFS, SJF, RR, or Priority could result in
starvation?
2. Consider the following set of processes, with the length of the CPU burst time and
arrival time given in milliseconds:
Process Arrival time Burst time Priority
P1052
P2231
P3385
P4314
P5623
Draw the Gandtt charts to illustrate the execution of the processes using the
following scheduling algorithms:
FCFS
SJF (preemptive)
Priority (preemptive)
RR with quantum = 3
3. Determine the average waiting time of the processes for each of the scheduling
algorithms in exercise 2.
4. Consider the following attempt to solve the mutual exclusion problem:
i = process_id(); // pid = 0 or 1
while (true)
{ while (turn == i)
; // no-op
Critical section
turn = 1-turn;
Remainder section
}
Variable turn is shared with initial value 0 and variable i is private. Suppose we
have two processes, P0 and P1, that want to enter the critical section.