This was a similar course, but not exactly the same schedule, syllabus,
or text
1. How large should a quantum be?
Suppose we are using preemptive process scheduling. Choosing the correct
quantum size (how long a process is allowed to run) is important to the
effective operation of the operating system. Consider a single processor
operating system that supports a large number of interactive users. Each
time a process gets the processor, the interrupt clock is set to interrupt
after the quantum Q expires. Assume that the same quantum is used for all
processes.
- What is the effect of setting the quantum to a very large value, say
ten minutes?
- What is the effect if the quantum is set to a very small value, say a
few processor cycles?
- Your answers to parts a) and b) should suggest that an appropriate
quantum must be in between these extremes. Suppose you could turn a dial
(or drag a slider bar) and vary the quantum. How would you know when you
had chosen the "right" value? What factors make this value right from
the user's perspective? What factors make it right from the system's
point of view?
Hint: This is a mathematical modeling question. It should remind you of
some calculus homework problems. Be as quantitative as possible.
2. Mutual exclusion with Test-and-Set
Consider the Test-and-Set instruction described in our text on
page 164. Let process P1 and process P2 running concurrently
be two copies of the
code suggested in Figure 6.7, page 165, where lock
is a shared memory location.
- Is deadlock possible? Explain.
- Is indefinite postponement possible? Explain.
- Why is indefinite postponement unlikely?
- Describe circumstances and an example application for which this
is an acceptable technique to enforce mutual exclusion
- Describe circumstances and an example application for which this
is NOT an acceptable technique to enforce mutual exclusion
3. Interprocess communication by send and receive
Suppose an operating system implements interprocess communication
with blocking send and blocking receive primitives. That is, a process Q
executing
send (P, message);
is blocked until process P executes
receive (Q, message);
Similarly, a process P executing
receive (Q, message);
is blocked until process Q executes
send (P, message);
- Does this usually work? Give a possible sequence of events
in which process Q successfully sends a message to process P, and
both are able to continue processing.
- Show four different scenarios under which deadlock occurs
- Can such deadlocks occur with non-blocking send and receive
calls? Explain
- Propose a modification to blocking calls that avoids such
deadlocks
4. Recovery from deadlock
Suppose that we recover from a deadlock by killing that process (or
those processes) with the lowest cost(s) of deletion. This
(these) processes are restarted and once again allowed to compete
for resources.
- What potential problems are posed by such an algorithm?
- How would you solve these problems?
5. Waiting
Management of waiting is an essential part of every operating system.
The text and I have discussed often the ready and
blocked waiting states.
- ready state
- List several ways a process could have gotten into the
ready state
- What is the process waiting for?
- Could the process get "lost" waiting indefinitely?
- blocked state
- List several ways a process could have gotten into the
blocked state
- What is the process waiting for?
- Could the process get "lost" waiting indefinitely?
- What features could an operating system incorporate to deal with
the possibility that processes could start to wait for an event that
might never happen?
|