UNIVERSITY OF HOUSTON Department of Computer Science COSC 4330—Fundamentals of Operating Systems MIDTERM EXAMINATION June 22, 1995 This exam is closed book. You can have one sheet of notes. 1. For each of the statements below, indicate in one sentence whether the statement is true or false (2 points), and why (3 points). (a) FCFS is a terrible scheduling policy for interactive systems (b) A process that has exceeded its quantum of CPU time is put in the waiting state. (c) Any scheduling policy that maximizes the system throughput will also minimize the system response time. (d) Peterson's algorithm assumes that each C statement is executed in an atomic fashion. 2. What is the major motivation for the microkernel approach in kernel design? (5 points) 3. What is the major advantage of kernel-level threads over user-level threads? (5 points) 4. What are the tasks performed by the server stub in a remote procedure call? (10 points) 5. What is the major difference between datagrams and virtual circuits? (10 points) 6. Why did the designers of UNIX chose to have separate fork() and exec() system calls instead of a single fork_and_exec()? (10 points) 7. What does the VMS scheduling policy do to favor I/O-bound processes over other regular processes? (10 points) 8. Give one major motivation to use kernel-supported semaphores instead of any user-level solution? (10 points) 9. What is wrong with the following solution to the mutual exclusion problem? (20 points) // Global variables #define FALSE 0 #define TRUE 1 int reserved[2]; reserved[0] = TRUE; reserved[1] = FALSE; void enter_region(int pid) { int other; // other process other = 1 - pid; while (reserved[other]); } // enter_region void leave_region(int pid) { int other; // other process other = 1 - pid; reserved[other] = TRUE; reserved[pid] = FALSE; } // leave_region --IMPORTANT----IMPORTANT----IMPORTANT----IMPORTANT----IMPORTANT-- Please do not try to answer these questions by yourself BEFORE having a clear idea of what's on the test for which you are studying. Materials covered in each test DO VARY from semester to semester because the pace of the course can change, some materials are be added and other deleted almost every semester. ----------------------------------------------------------------