Banker's Algorithm - Operating Systems and System Programming - Exams, Exams of Operating Systems

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

2012/2013

Uploaded on 04/02/2013

shaina_44kin
shaina_44kin 🇮🇳

3.9

(9)

64 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS162, Fall 1991
Midterm #1
Professor Alan Smith
Problem #1
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)
Problem #2
What advantages (if any) are there in having different quantum sizes on different levels of a multilevel
scheduling queueing algorithm. (10)
Problem #3
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)
Problem #4
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
Problem #5
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
pf2

Partial preview of the text

Download Banker's Algorithm - Operating Systems and System Programming - Exams and more Exams Operating Systems in PDF only on Docsity!

CS162, Fall 1991

Midterm

Professor Alan Smith

Problem

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)

Problem

What advantages (if any) are there in having different quantum sizes on different levels of a multilevel scheduling queueing algorithm. (10)

Problem

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)

Problem

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

Problem

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)? ____

Problem

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)

Posted by HKN (Electrical Engineering and Computer Science Honor Society)

University of California at Berkeley

If you have any questions about these online exams

please contact [email protected].

CS 162, Midterm #1, Fall 1991

Problem #5 2