Final Exam - Operating Systems, Spring 2006 | CSE 430, Exams of Operating Systems

Material Type: Exam; Class: Operating Systems; Subject: Computer Science and Engineering; University: Arizona State University - Tempe; Term: Spring 2006;

Typology: Exams

Pre 2010

Uploaded on 09/02/2009

koofers-user-in4-1
koofers-user-in4-1 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 430
SPRING 2006 FINAL EXAM
(3:15CLASS)
NAME
Put Name on Every Page
1. (15 + 3 points extra credit) Demand Paged Memory Management
Given the following sequence of page references from a program:
2, 3, 2, 1, 5, 2, 4, 5, 3, 2
and assuming 100 word pages and that 300 words of primary memory are available to the
program, find the number of page faults using each of the three page replacement algorithms
indicated below.
Note: To obtain partial credit on these parts you must show how you got your answers.
(a) (5) LRU
(b) (5) Optimal
(c) (5) Clock
(d) (3 points extra credit) Explain why Optimal does not suffer from Belady’s anomaly. Note:
Saying that it is a stack algorithm gets you zero points. You need to show how it comes about
that if you increase the number of frames the thing that happens in Belady’s anomaly can’t
occur.
pf3
pf4
pf5

Partial preview of the text

Download Final Exam - Operating Systems, Spring 2006 | CSE 430 and more Exams Operating Systems in PDF only on Docsity!

CSE 430

SPRING 2006

FINAL EXAM

(3:15CLASS)

NAME

Put Name on Every Page

1. (15 + 3 points extra credit) Demand Paged Memory Management Given the following sequence of page references from a program: 2, 3, 2, 1, 5, 2, 4, 5, 3, 2 and assuming 100 word pages and that 300 words of primary memory are available to the program, find the number of page faults using each of the three page replacement algorithms indicated below. Note: To obtain partial credit on these parts you must show how you got your answers. (a) (5) LRU (b) (5) Optimal (c) (5) Clock (d) (3 points extra credit) Explain why Optimal does not suffer from Belady’s anomaly. Note: Saying that it is a stack algorithm gets you zero points. You need to show how it comes about that if you increase the number of frames the thing that happens in Belady’s anomaly can’t occur.

CSE 430 FINAL EXAM SPRING 2006

(3:15 Class)

NAME

Put name on EVERY page

2. (10) Synchronization Hardware Boolean lock; while (true) { while ( TestAndSet (&lock )) ; /* do nothing // critical section lock = FALSE; // remainder section } Shown above are two ways the TestAndSet hardware instruction can be used to insure mutual exclusion. (a) (3)What advantage does the solution on the right have over the solution on the left? (b) (3) Show that the solution on the right meets the mutual exclusion requirement for the solution to the critical section problem. (c) (4) Show that the solution on the right meets the bounded waiting requirement for the critical section problem. Include in your answer what the upper bound on the waiting time for a process that wants to enter the critical section is. Boolean waiting[n]; Boolean lock; do { waiting[i] = TRUE; key = TRUE; while (waiting[i] && key) key = TestAndSet(&lock); waiting[i] = FALSE; // critical section j = (i+1) %n; while ((j != i) && !waiting[j]) j = (j + 1) %n; if (j == i) lock = FALSE; else waiting[j] = FALSE; // remainder section } while (TRUE);

CSE 430 FINAL EXAM SPRING 2006

(3:15 Class)

NAME

Put name on EVERY page

4. (25) Deadlock (a) (10) For each of the two systems whose resource allocation state is shown by the graphs below, state whether the system is in deadlock or not. If the system is in deadlock state what it is about the figure that indicates this and if the system is not in deadlock give a possible completion sequence for the processes. (b) (10) Name the 4 necessary conditions for deadlock to hold. (c) (5) For one of the necessary conditions you named in (b) above, say why it’s impracticable to prevent deadlock by preventing this condition from holding.

CSE 430 FINAL EXAM SPRING 2006

(3:15 Class)

NAME

Put name on EVERY page

5. (12) Handheld Systems Name three characteristics of Handheld Systems that place constraints on the design of operating systems for them. For two of these characteristics state what operating system designers must do to accommodate them. 6. (10) System Design and Implementation. What is meant by designing operating system modules in such a way that policy and mechanism are separated? Why is it important? Give an example.