
CS 471 – Exam 2
Name:___________________
Feb. 26 2002
Instructions: This exam must be mailed to cmo by midnight, April 25, 2002. You may submit
either a Word or a text file. The exam is open book, open notes.
1. (12 pts) Consider the following page reference string:
1 2 3 1 2 4 2 1 2 5 1 2 3 4
a. For a FIFO page replacement algorithm with 4 frames, how many page faults are generated?
Show work.
b. For a LRU page replacement algorithm with 4 frames, how many page faults are generated?
Show work.
c. For the Optimal page replacement algorithm with 4 frames, how many page faults are generated?
Show work.
2. (5 pts) If a page size is 2048, how many bits are required for the offset in the address?
3. (6 pts) Under what circumstances is hashing useful for virtual memory systems?
4. (6 pts) How does paged memory solved the external fragmentation problem? Why does it not solve
the internal fragmentation problem?
5. (6 pts) How does use of a “dirty” bit improve virtual memory performance?
6. (4 pts) In the semaphore solution for the bounded buffer problem, why are two, rather than one
semaphore needed? (Explain the purpose of each, that is, why it is necessary.)
7. (6 pts) In a system with paging, a process cannot access memory that it does not own. Why?
8. (6 pts) Many virtual memory systems use an approximation of an LRU algorithm.
a. Why is the LRU algorithm preferred?
b. Why is it not used?
9. (6 pts) Consider a system in which the unallocated space for a file system is kept in a free space list.
If this list were to become corrupted, could the operating system reconstruct it?
10. (6 pts) If a multiuser system begins to thrash,
a. How could the OS detect that it is in a thrashing state?
b. What reasonable actions could the OS take to reduce thrashing?
11. (6 pts) Consider a paged memory system (with no virtual memory). Suppose memory access time
is 40 nanoseconds and that it takes 15 nanoseconds to search the associative memory used to
store part of the page table. If the hit rate for this associative memory is 0.98, what is the effective
memory access time?
12. (8 pts) Consider the following code for TestAndSet operation intended to be used to provide mutual
exclusion:
boolean TestAndSet(boolean &target) {
boolean rv = target;
target = true;
return rv;
- 1 -