CS 311
30 points, due Mar. 28, 2011
int FAI(int& val)
{
return val++; // Performed atomically.
}
Devise a solution to the critical section problem for Show that your solution is, in fact, a solution to the critical section problem.
| Process | Arrival Time | CPU Burst | Priority |
| P1 | 0 | 5 | 3 |
| P2 | 2 | 2 | 1 |
| P3 | 2 | 3 | 3 |
| P4 | 3 | 3 | 4 |
| P5 | 4 | 4 | 2 |
Draw four Gantt charts illustrating the execution of these processes using
FCFS (non-
preemptive), preemptive SJF, non-preemptive priority (a smaller
priority number implies a higher priority), and RR (quantum = 1).
Also, for each scheduling algorithm, answer the following: