\documentstyle[11pt]{article}

\addtolength{\oddsidemargin}{-0.75in}
\addtolength{\textwidth}{1.0in}
\addtolength{\textheight}{1.0in}
\addtolength{\topmargin}{-0.5in}

\begin{document}

\thispagestyle{empty}

\hfill

\begin{center}
{\Large \bf CS-230 Final Exam} \\
\vspace*{0.1in}
December 12, 1994
\end{center}

\hfill

\begin{enumerate}

\item
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?

\item
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?

\item
Suggest a way to implement semaphores ({\it 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?

\item
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:
\begin{enumerate}
\item How the operating system would know that a process needed to use a
shared library.
\item When a shared library would get loaded into and removed from memory.
\item How the operating system would keep track of the processes using
the library.
\item How sharing libraries between processes might influence
the choice of page replacement algorithms.
\end{enumerate}

\hfill
\newpage

\item
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:
\begin{verbatim}
     status = Join(``Thread Name'');
\end{verbatim}
Suggest a method for naming processes so that any process could join
any other.  How would the arguments and return value of the
\verb|Exec(...)| system call be affected, if at all?  

\item
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?
\end{enumerate}

\end{document}
