If burst lengths are known in advance, what scheduling algorithm yields the shortest average waiting time for processing a fixed collection of bursts?
- First come first serve.
- Longest job first.
- Shortest job first.
- It doesn't matter: they all have the same average waiting time.
What does the term priority inversion refer to?
- A situation where a process has been assigned the wrong priority.
- A data structure where the priority queue is stored backwards.
- A situation where a low priority process must wait for a high priority process.
- A situation where a high priority process must wait for a low priority process.
How can a priority inversion be corrected (in the least intrusive way)?
- Temporarily lowering the priority of a high priority process.
- Temporarily raising the priority of a low priority process.
- Not allowing a low priority process to perform system calls.
- Not allowing a high priority process to perform system calls.
Which of the following operations would MOST LIKELY need to be inside a critical section?
- Fetch the value of a nonshared variables.
- Fetch the value of a shared variable.
- Reduce the value of a nonshared variable by 1.
- Reduce the value of a shared variable by 1.
Under what situation would a spin-lock be preferred over a kernel-level
semaphore variable in Solaris 2?
- Protection of a short critical section on a single-processor machine.
- Protection of a short critical section on a multi-processor machine.
- Protection of a long critical section on a single-processor machine.
- Protection of a long critical section on a multi-processor machine.
Which of the following events would be LEAST LIKELY to cause the end of a CPU burst by a running thread?
- Performing an input/output operation.
- Performing a wait on an unblocked semaphore.
- Performing a wait on a blocked semaphore.
- Waiting to receive a message from another thread.
Only one of the following would be a feature of an ideal solution to the readers-writers problem. Which one?
- Allowance for concurrent reading.
- Allowance for concurrent writing.
- Allowance for reader lockout.
- Allowance for writer lockout.
A synchronization algorithm is wait-free if, when it is used, no thread
- ever needs to wait for another thread to do anything, under any circumstances.
- needs to wait for any other thread, as long as no thread spends long inside critical sections.
- needs to wait for any other thread that does not want to enter a critical section.
- can be made to wait to enter a critical section while more than some bounded number of other threads enter the critical section ahead of it.
An advantage of a preemptive scheduler over a nonpreemptive
scheduler is
- If a fixed collection of bursts is to be done, the total time
to complete the bursts is smaller with the preemptive scheduler.
- A preemptive scheduler prevents a process from being locked
out of the CPU.
- A preemptive scheduler makes solution of the critical section
problem easier.
- A preemptive scheduler is easier to implement than a
nonpreemptive sheduler.
What is a test-and-set instruction, and what is it useful for?
A test-and-set instruction atomically
fetches the value of a variable and sets the variable to hold 1.
It is useful for solving the critical section problem.