


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



(30) 1. Given the following jobs: Job # Arrival Time Run Time Priority (1 is highest) 1 0 6 4 2 1 4 2 3 3 3 1 4 4 2 3 (18) (a) Draw a Gantt chart to illustrate the execution of these jobs for each of the following 6 CPU scheduling algorithms: Nonpreemptive SJF; Preemptive SJF; Round Robin with q= Make the following assumptions to handle 'ties.' In Preemptive SJF, an arriving job must have less time than the remaining burst time of a running job in order to preempt it. In Round Robin, if a job arrives at exactly the same time as another uses up its time quantum, the algorithm doesn't specify which job precedes the other at the tail of the queue, i.e., you can solve the problem using either one of these assumptions. (5) (b) What is the average waiting time for Round Robin? (5) (c) What is the average turnaround time for Preemptive Shortest Job First? (2) (d) What is aging and why is it used?
(30) 2. Consider the following snapshot of a computer system. ALLOCATION MAXIMUM AVAILABLE R 1 R 2 R 1 R 2 R 1 R 2 P 1 1 1 P 1 3 2 1 1 P 2 1 1 P 2 4 3 P 3 1 1 P 3 5 4 P 4 1 1 P 4 1 1 Answer the following questions using the Banker's Algorithm for deadlock avoidance. For full credit on parts b, c and d, if you believe that the system is in a safe state or that the request can be granted, you must show a safe sequence and if you believe that the system is not in a safe state or that the request cannot be granted, you must demonstrate why this is so. (a) What are the contents of the NEED array. (b) Is the system in a safe state? (c) Suppose P 3 requests one additional instance of R 2 , can the request be granted? (d) Starting again from the original snapshot, suppose P 3 requests one additional instance of R 1 , can the request be immediately granted?
Questions 4 through 9 are worth (1 point each)