99sol - CS 414 Prelim 2 Solution Set 1 hour closed book 100 points Each question is worth 20 points and if a question has n parts each part is

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 414 Prelim 2 Solution Set 1 hour, closed book. 100 points Each question is worth 20 points, and if a question has n parts, each part is worth the same number of points. 1. Suppose that an operating system uses the Banker’s Algorithm for resource allocation. People make accurate worst-case estimates of resource use. But “worst case” is rarely the “typical case. Suppose that we measure the actual performance of the operating system, and find that there is always about 10% or more of each type of resource free – unused. a) Explain why this might happen with the Banker’s Algorithm. The Banker’s Algorithm operates very conservatively: it only grants a request if it is sure that some scheduling sequence still exists in which every process can make worst-case requests and that it would still be possible to execute each one to completion in this scheduling order. If worst-case estimates are very pessimistic, this can lead to executions in which the Banker is constantly worrying about scenarios that don’t actually occur. b) What if we modify the Banker’s Algorithm so that the safety test pretends to have 10% “extra” available for all resources that have large numbers of units. That is, if we actually have 20000 disk blocks and 10 magnetic tape drives, we would pretend to have 22000 disk blocks and 11 magnetic tape drives, etc. Presumably, if we re-measure the performance of the operating system, it will no longer be leaving resources unused. But what other consequences would this change have? Technically speaking, this change creates the potential for deadlock. But if the observation was 100% accurate and we never demanded the worst-case amount of resources, deadlock should never be observed. We could get the same result by fixing the estimates maximum utilization (which would also seem a bit more honest as a way to address the underlying issue). Were one to actually make this change, it would be wise to also use a deadlock detection algorithm of some sort, and to terminate deadlocked processes – just in case…
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2. Suppose that UNIX user A and user B are working together on a project at their company, and they are both editing a file called “recommendations.” B has the real file and A has a link to it. a) Suppose that A had a symbolic link to recommendations, and B edits the file using a program that creates a new version, then deletes the old version, and then renames the new version using the old name. A now opens the file. Does A get the new version or the old one (the one that was deleted by B)? Explain your answer.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2011 for the course CS 4410 taught by Professor Vollset during the Spring '07 term at Cornell University (Engineering School).

Page1 / 7

99sol - CS 414 Prelim 2 Solution Set 1 hour closed book 100 points Each question is worth 20 points and if a question has n parts each part is

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online