Test 3 - Input-Output

CS 505, Operating Systems Concepts


  1. Distinguish between block devices and character devices.


    Block devices handle data most efficiently when it is grouped into blocks of usually between one-half and four to six kbytes; block devices include disks and network intefaces.

    Character devices handle data most efficeintly as individual bytes, or small clusters of up to around 256 bytes; character devices include terminals and the serial or parallel ports.


  2. What is direct memory access (DMA)? How does DMA improve computer system performance?


    Direct memory access is the ability of a device controller to transfer data to or from a computer system's main storage without involving the CPU in the transfer. By providing independent data transfer between device and main storage, DMA frees up the CPU, making it available for other tasks.


  3. What are the four necessary and sufficient conditions for deadlock?


    1. Non-preemptive devices - Once assigned to a process, a non-pre-emptive device can't easily be taken away and given to another process.

    2. Mutually exclusive access - A process with mutually exclusive access to a device doesn't share the device with other processes.

    3. hold while waiting - A process holds on to allocated resources while waiting for an outstanding request, instead of releasing them until the new request is fufilled.

    4. A cyclic pattern of requests and grants among processes and resources - this is when the deadlock actually occurs.


  4. Describe one technique for avoiding each of the four deadlock conditions.


    1. Non-preemptive devices - When deadlock occurs, the operating system can kill one of the blocked processes, freeing up the devices held by that process.

    2. Mutually exclusive access - The operating system can multiplex devices among several processes, eliminating the need for mutual exclusion.

    3. hold while waiting - A process can give up its currently held resources if its forced to wait for a requested resource.

    4. Cyclic patterns - The operating system can maintain a model of requests and grants among processes and resources and deny or delay an grant that would result in a cycle.



This page last modified on 6 March 2000.