

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
Main points of this exam paper are: Banker'S Algorithm, Banker'S Algorithm, Safe Sequence, Busy Waiting, Quantum Sizes, Scheduling Queueing, Queueing Algorithm, Synchronization Problems, Precludes Busy-Waiting, Safe State
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!


When a compiler compiles a program and produces the corresponding object module(s), it also produces some information (in tables) to be used by the linker/loader. Please list and describe all such information, and explain why the linker/loader needs it. (15)
What advantages (if any) are there in having different quantum sizes on different levels of a multilevel scheduling queueing algorithm. (10)
What is the meaning of the term "busy waiting?" What other kinds of waiting are there? Can busy waiting be avoided altogether, assuming a machine with a "swap" instruction for synchronizaion. Explain. (12)
Simulate the banker's algorithm to get a safe sequence for the following: There are 15 units currently free (available). (10)
process already allocated total need A 100 250 B 40 180 C 20 30 D 110 140
The following questions are true/false or multiple choice. Please enter the appropriate answer: (33) a. Test-and-set is an atomic operation (T/F): ____
b. The use of Test-and-set in synchronization problems precludes busy-waiting (T/F): ____
c. In a uniprocessing system, one must be able to disable interrupts in order to correctly implement P() and V() (T/F): ____
d. In a multiprocessing system, it is sufficient to disable interrupts in order to implement P() and V() (T/F):
e. When running the Banker's Algorithm, a safe state could not possible lead to deadlock (T/F): ____
f. When running the Banker's Algorithm, if there are two processes whose requests can be granted fully with
CS 162, Midterm #1, Fall 1991
CS162, Fall 1991 Midterm #1 Professor Alan Smith 1
the available resources, it doesn't matter, in terms of correctness, which one's requests are granted first (T/F):
g. A circular allocated-resource graph is a necessary ingredient for deadlock (T/F): ____
h. If the resources in a system are of different types, and there is only one instance of each resource type, deadlock is not possible (T/F): ____
The following kinds of jobs should be assigned to F or B in a system with foreground/background scheduling: i. CPU intensive (F/B)? ____
j. Interactive (F/B)? ____
k. Newly arrived (F/B)? ____
A barbershop consists of a waiting room with n chairs, and the barber room with one barber chair. If there are no customers to be served, the barber goes to sleep. If a customer enters the barbershop and all chairs are occupied, then the customer leaves the shop. If the barber is busy, but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program (using P's and V's) to coordinate the barber and the customers. (20)
CS 162, Midterm #1, Fall 1991
Problem #5 2