{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

99sol

# 99sol - CS 414 Prelim 2 Solution Set 1 hour closed book 100...

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

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…

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

View Full Document
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.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern