COSC 4330 FINAL 8/11/98 Closed Book. You can have one sheet of notes. 1. For each of the statements below, indicate in one sentence whether or not the statement is true or false, and why (5 points each): a) There is no easy way to implement the at most once semantics in remote procedure calls. FALSE. You just need to add a unique ID to each client request. b) If your computer has a test and set instruction, you do not need semaphores to avoid busy waits. FALSE. All user level solutions require busy waits. c) One page fault every five hundred references is an acceptable page fault rate for a virtual memory system. FALSE. An acceptable page rate is one fault each 50,000 to 200,000 references. d) The LRU policy always expels the page that has been the least frequently referenced since it was brought into main memory. FALSE. Itexpels the page that has been the least recently referenced since it was brought into main memory. e) There is no efficient way to pass huge arrays in a remote procedure call. TRUE. You must send a copy of each array. f) Dynamic address translation is normally done by the software. FALSE. It is done by the Memory Management Unit. 2. A computer has 32 bit addresses and a page size of one kilobyte.(2×5 points) a) How many bits are used to represent the page number ? _22_ bits b) What is the maximum number of entries in a process page table? __2^22= 4 M = around 4 million___ entries 3. What is the difference between internal fragmentation and external fragmentation? (10 points) Which of them wastes more memory than the other and what can be done about it? (2×5 points) Internal fragmetnation happens in paged virtual memory systems and wastes an average of one half a page frame per process. External fragmentation happens in ssytems using variable partitions to manage their memory. It results from the fact that free blocks tend to become very small because each process occupying the memory space freed by another process cannot normally occupy all the freed space. The only real solution to memory fragmentation is compaction. It involves merging all free blocks into a single large free block by moving around some of the processes. Its most serious disadvantage is the cost of moving processes around, which is a function of their sizes and, ultimately, of the size of the main memory. Hence, memory compaction is a much lesser attractive solution today than it was when main memories were much smaller. 4. Compare and contrast semaphores and monitor conditions? (2×5 points) Unlike semaphores monitor conditions have NO VALUE. Hence, a signal operation on a monitor condition will have NO EFFECT unless there is a process waiting on that condition. This is NOT TRUE for V() operations on semaphores. 5. What are the major advantage and disadvantage of the FIFO page replacement policy? (2×5 points) Name a page replacement policy that uses FIFO and explain what it does to correct the deficiencies of that policy. (2×5 points) FIFO is very easy to implement (and cheap to run) but often expels the wrong page. The Mach page replacement uses global FIFO but puts expelled pages at the tail end of a global queue from which they can be reclaimed by processes trying to access them. OR The VMS page replacement assigns a fixed partition to each process and manages each of them using a FIFO policy. Expelled pages are put at the tail end of a global queue from which they can be reclaimed by processes trying to access them.