


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The questions and instructions for the midterm 2 exam of the cse 430: operating systems course, held in fall 2004. The exam covers topics such as cpu scheduling algorithms, classical synchronization problems, and process coordination. Students are required to answer questions related to gantt charts, average waiting time, scheduling algorithms, dining philosophers problem, and concurrency vs. Fairness.
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



1. (30) Scheduling Given the following processes: Process # Arrival Time Run Time Priority (1 is highest) A 0 5 3 B 1 3 2 C 3 2 1 (16) (a) Draw a Gantt chart to illustrate the execution of these processes for each of the following 3 CPU scheduling algorithms: Shortest Remaining Time First; Preemptive Priority; Round Robin with q=2 and FCFS. (b) (5) What is the average waiting time for Round Robin with q=2? (c) (4) Most modern operating systems include a scheduling ‘aging’ mechanism. What is aging and why is it used? (d) (2) What scheduling algorithm does round robin approach as the quantum size approaches infinity? (e) (3) What determines the practical lower bound on the time quantum for Round Robin process scheduling and why is this so?
2. (25 + 3points extra credit) Classical Synchronization Problems For this question use the Addendum to Final Exam which contains four solutions to the dining philosophers problem. (a) (5) Which solution can fail because of deadlock? Why? (b) (5) Of the remaining solutions, assuming entries in semaphore queues are processed FCFS, which solution can lead to starvation? Why? (c) (10) Solutions to synchronization problems exhibit a concurrency vs. fairness tradeoff. Compare solutions 2 and 4 in this respect. Note: You need to state what concurrency is allowed by each solution and what limitation on fairness occurs in each solution. (d) (5) In solution 4 the mutex semaphore provides mutually exclusive access by allowing only one process at a time to execute critical sections of code? What is the shared data area that the critical sections of code access? (e) (extra credit question 3 points) Compare solutions 3 and 4 with respect to concurrency and fairness. As in part (c), you need to state what concurrency is allowed by each solution and what limitation on fairness occurs in each solution. You must include an example of when the allowed concurrency is different.
4. (25) Deadlock (a) (16) Given the following well-known bridge crossing example of deadlock show that the 4 necessary conditions for deadlock hold. (b) (5) Briefly describe a resource allocation protocol that prevents deadlock by preventing hold and wait from being true. (c) (4) State how this protocol would be used to prevent deadlock in the bridge crossing example above.