Computer Science 4630
Spring 2000
Quiz 2
This is a closed book test. Circle the letter of the best answer to each question.
(a) Deciding whether to move a process from disk to main memory.
(b) Deciding whether to reduce the priority of a process.
(c) Deciding which process from the ready queue to run next.
(d) Increasing the priority of a process to avoid a priority inversion.
(a) First come first serve.
(b) Longest job first.
(c) Shortest job first.
(d) It doesn’t matter: they all have the same average waiting time.
(a) A situation where a process has been assigned the wrong priority.
(b) A data structure where the priority queue is stored backwards.
(c) A situation where a low priority process must wait for a high priority process.
(d) A situation where a high priority process must wait for a low priority process.
(a) The critical section problem for just two processes using busy-waiting.
(b) The critical section problem for just two processes using semaphores.
(c) The critical section problem for multiple processes using busy-waiting.
(d) The critical section problem for multiple processes using semaphores.
(a) Fetch the value of a nonshared variables.
(b) Fetch the value of a shared variable.
(c) Reduce the value of a nonshared variable by 1.
(d) Reduce the value of a shared variable by 1.
(a) Protection of a short critical section on a single-processor machine.
(b) Protection of a short critical section on a multi-processor machine.
(c) Protection of a long critical section on a single-processor machine.
(d) Protection of a long critical section on a multi-processor machine.
(a) Temporarily lowering the priority of a high priority process.
(b) Temporarily raising the priority of a low priority process.
(c) Not allowing a low priority process to perform system calls.
(d) Not allowing a high priority process to perform system calls.
(a) Performing an input/output operation.
(b) Performing a wait on an unblocked semaphore.
(c) Performing a wait on a blocked semaphore.
(d) Waiting to receive a message from another thread.
(a) 1 nanosecond
(b) 1 microsecond
(c) 1 millisecond
(d) 1 second
(a) Monitors can be used to implement semaphores.
(b) Monitors can be used to solve the critical section problem.
(c) Monitors can only be used if they are provided within a programming language.
(d) Monitors provide wait-free synchronization.
(a) Allowance for concurrent reading
(b) Allowance for concurrent writing.
(c) Allowance for reader lockout.
(d) Allowance for writer lockout.
(a) ever needs to wait for another thread to do anything, under any circumstances.
(b) needs to wait for any other thread, as long as no thread spends long inside critical sections.
(c) needs to wait for any other thread that does not want to enter a critical section.
(d) 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.