CS 318
50 pts., due Mar. 13
Write pseudo-code for the disk process and the two system level library functions. Clearly indicate the content of mailbox messages.
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:
int flag[2] = { FALSE, FALSE } /* flag[i] indicates that Pi wants to */ /* enter its critical section */ int turn = 0; /* turn indicates which process has */ /* priority in entering its critical */ /* section flag[i] = TRUE; while (flag[1 - i]) if (turn == 1 - i) { flag[i] = FALSE; while (turn == 1 - i) ; flag[i] = TRUE; } CSi; turn = 1 - i; flag[i] = FALSE;Prove that the algorithm satisfies the three requirements for a solution to the CS problem.