Test 2 - Resource Management

CS 438, Operating Systems Analysis


  1. Is it a good idea to use buffering with in DMA devices? Explain.


    Not only is it a good idea, it is a necessary idea because DMA reads and writes memory areas (a.k.a. buffers) under direction of the system's CPU.


  2. Briefly explain the steps you would take to implement non-blocking disk io in your second assignment.


    A user process making a non-block disk I-O call returns immediately after issuing an operation (a read or write), rather than blocking until the operation continues.

    The principle change required by non-blocking is a new system call that lets a user process determine when its o.k. to manipulate the buffer passed along with the disk operation. This status system call would, for example, return false while the buffer is being used in the operation and true when the buffer is ready for further use by the user process.

    Another change, not required but helpful for providing improved concurrency, is internal buffering within the disk driver. Internal buffering lets the controller finish with the user-process supplied earlier than might be possible otherwise (this makes more sense for reading than for writing). On the other hand, copying increases the cost for the operation by moving data one more time than is necessary.


  3. Is it possible for a process to deadlock with itself? If so, give an example; if not, describe which of the four deadlock requirements does not hold.


    Of course; the simplest cycle possible is a node pointing to itself. A process could form a self loop by, for example, joining on its own process id.


  4. Suppose a system makes only one resource R available for allocation to processes. Even though the system takes no special precautions against deadlock, it never deadlocks over resource allocations. How many units of resource R does the system have available? Explain.


    It must have one unit of the resource. With more than one unit, two processes could each successfully allocate around half of R and then go on to allocate the other half, resulting in deadlock.



This page last modified on 8 August 2002.