CS-230 Final Exam

December 12, 1994

1. Draw a typical state transition diagram for the processes in an Operating System. Describe each of the states. Explain which states are necessary, and which are just desirable. Why are they desirable?

2. Preemptive round robin process scheduling is generally fair and a reasonable choice for operating system use. However, round robin scheduling can allow response times to become intolerable when using a workstation with a highly interactive, graphical user interface. One approach to shortening the response time for mouse movements and button clicks is to split interactive programs into two threads: one to deal just with the user interface, and one to do all the real work. The interface thread can then be given a high priority so it will immediately takes control when required.

Would a strict priority based scheduling scheme work in this situation? Would a scheme with varying priorities be better or worse? Why? If a strict two-layer priority scheduler was desired, what could the operating system do to prevent abuse by users who give non-interface threads a high priority?

3. Suggest a way to implement semaphores (ie., Create, Signal, and Wait) using message passing. (Hint: Introduce a separate synchronization process.) Is hardware support for mutual exclusion required in your proposal? Why, or why not? Will your solution work if the processes using a semaphore are on different machines?

4. On of the advantages of virtual memory is the ability of processes to share common run-time libraries. For example, the standard ’C’ I/O and math functions can be shared between all ’C’ programs running on a single SUN SparcStation. Discuss the Operating System issues involved in sharing libraries in a paged, virtual memory system. Be sure to address:

(a) How the operating system would know that a process needed to use a shared library.

(b) When a shared library would get loaded into and removed from memory.

(c) How the operating system would keep track of the processes using the library.

(d) How sharing libraries between processes might influence the choice of page replacement algorithms.

5. In class, we briefly discussed the issues involved in naming disk files and the ways an Operating System might find the initial block of a file given its name. A similar problem exists in process management if the Operating System wishes to allow one process to join to another using a name instead of an assigned id. For example, the O/S might support the call:

     status = Join(``Thread Name'');

Suggest a method for naming processes so that any process could join any other. How would the arguments and return value of the Exec(...) system call be affected, if at all?

6. The next NACHOS programming assignment is to implement demand paged memory. That assignment carries on directly from the second assignment without supplying any additional code. Assuming your solution to the second assignment is correct, you will have implemented a way to load multiple processes into memory and schedule their execution. What major features will you would need to add to support demand paging? Would you still allocate initial pages of physical memory in the same way you did for assignment two?