


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 exam of cse 430: operating systems, held in spring 2008. The exam covers topics such as cpu scheduling algorithms, process coordination, and classical synchronization problems. Students are required to answer questions related to gantt charts, mutual exclusion, the dining philosophers problem, and monitor synchronization.
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Put Name on Every Page
1. (30) Scheduling Given the following jobs: Job # Arrival Time Run Time Priority (1 is highest) A 0 3 5 B 2 6 4 C 4 4 3 D 6 5 2 E 8 2 1 (a) (18) Draw a Gantt chart to illustrate the execution of these jobs for each of the following 3 CPU scheduling algorithms: Shortest Remaining Time First; Preemptive Priority and Round Robin with q=4. Make the following assumption to handle 'ties.' In Shortest Remaining Time First, if two jobs have the same shortest remaining time, the one that arrived first gets to go. Helpful Hint : Take your time. Be careful on SRTF and RR. (b) (6) What is the average waiting time for Preemptive Priority? (c) (3) What bound does context switch time place on the quantum for Round Robin process scheduling and why is this so? (d) (3) Why is it essentially impossible to implement Shortest Remaining Time First?
Put Name on Every Page
2. (25 + 2 points extra credit) Process Coordination For this question use the Addendum to MT2 which contains Peterson’s solution for achieving mutual exclusion and also obtaining mutual exclusion by setting and clearing locks using a HW instruction similar to TestAndSet. (a) (8) Explain how this solution guarantees mutual exclusion. (b) (8) Explain how this solution guarantees a bounded waiting time on the selection of a given process. Include in your explanation what that bound is. (c) (9) Obtaining mutual exclusion by setting and clearing locks using a tsl register,flag instruction similar to TestAndSet as shown in the figure at the bottom of the handout clearly provides a much simpler solution to the mutual exclusion problem. It implements memory access operations in a way that we could not assume when designing a software protocol for mutual exclusion. What is different about the characteristics of the memory operations assumed in Peterson’s software protocol and the characteristics of the memory operation present in the tsl register,flag instruction. NOTE : To answer this question you need to state the particular relevant characteristic of memory operations assumed in Peterson’s protocol and the corresponding particular relevant characteristic of memory operations in the tsl register,flag instruction. (d) (2 pts. extra credit) T or F The solution using the tsl register,flag instruction also provides bounded waiting.
Put Name on Every Page
4. (17 + 3 points extra credit) More Process Coordination (a) (2) T or F At a higher level we have the same problems in correctly using monitors as we had with correctly using semaphores. (b) (3) Explain why disabling interrupts is not appropriate for implementing synchronization primitives in multiprocessor systems. (c) (5) Why do Solaris, Linux, and Windows 2000 use spinlocks as a synchronization mechanism only on multiprocessor systems and not on single-processor systems? (d) (7) Explain how that if the signal semaphore operation is not executed atomically, then for the case where the semaphore controls access to multiple instances of the same type (e.g., 3 printers), access to one or more of the resources could be eliminated. (e) (3 pts. extra credit) How does the signal() operation associated with monitors differ from the corresponding operation defined for semaphores?