Test 1 - Processes

CS 438, Operating Systems Analysis


  1. Can processes starve under round-robin scheduling? Explain.


    Generally speaking, no, a process cannot starve under round-robin scheduling. Each process is regularly yanked from the CPU, meaning all processes eventually get to execute, avoiding starvation (it may be that a process does not get to execute often enough in round-robin scheduling, but that is not starvation).


  2. Explain how to use message passing to solve the producer-consumer problem. Don't go into code-level detail, just describe the general approach.


    The producer can send its data in a message to the consumer. This eliminates the need for the producer and consumer to synchronize over access to a shared buffer. See Section 2.2.7 of the text for more details.


  3. Explain at least two different ways in which you might apply two-level scheduling in a multi-processor system.


    One way is as we discussed in class: one scheduler between cpu and primary store and the other between primary store and secondary store. These two schedulers are different (the CPU scheduler is, in some sense, faster and more sensitive than the disk scheduler), but the schedulers are related in that they both deal with processes.

    Another way in which two-level scheduling might apply is in assigning processes to processors. Each process that enters the system needs to be assigned to a processor (or, if you like, the processes on one processor may need to be redistributed to improve load balancing). A scheduler that assigns processes to processors is different than a scheduler that shuffles processes into and out of a particular process, but they are related in that they both deal with processes.


  4. In a multiprocessing OS, does it make sense to talk about multiple program counters? If it does make sense, how many program counters are there?


    Yes, it makes sense. Even if the hardware has only one program counter register, each program that is running has a point of current execution, that is, a program counter. The operating system maps the process program counter into the program counter register.

    There is one program counter per process that is executing in the system.



This page last modified on 12 October 2000.