Quiz
os 6
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (24)
1A race condition ____.
- Aresults when several threads try to access the same data concurrently
- Bresults when several threads try to access and modify the same data concurrently
- Cwill result only if the outcome of execution does not depend on the order in which instructions are executed
- DNone of the above
2An instruction that executes atomically ____.
- Amust consist of only one machine instruction
- Bexecutes as a single, uninterruptible unit
- Ccannot be used to solve the critical section problem
- DAll of the above
3A counting semaphore ____.
- Ais essentially an integer variable
- Bis accessed through only one standard operation
- Ccan be modified simultaneously by multiple threads
- Dcannot be used to control access to a thread's critical sections
4A mutex lock ____.
- Ais exactly like a counting semaphore
- Bis essentially a boolean variable
- Cis not guaranteed to be atomic
- Dcan be used to eliminate busy waiting
5In Peterson's solution, the ____ variable indicates if a process is ready to enter its critical section.
- Aturn
- Block
- Cflag[i]
- Dturn[i]
6The first readers-writers problem ____.
- Arequires that, once a writer is ready, that writer performs its write as soon as possible.
- Bis not used to test synchronization primitives.
- Crequires that no reader will be kept waiting unless a writer has already obtained permission to use the shared database.
- Drequires that no reader will be kept waiting unless a reader has already obtained permission to use the shared database.
7A ___ type presents a set of programmer-defined operations that are provided mutual exclusion within it.
- Atransaction
- Bsignal
- Cbinary
- Dmonitor
8____________ occurs when a higher-priority process needs to access a data structure that is currently being accessed by a lower-priority process.
- APriority inversion
- BDeadlock
- CA race condition
- DA critical section
9What is the correct order of operations for protecting a critical section using mutex locks?
- Arelease() followed by acquire()
- Bacquire() followed by release()
- Cwait() followed by signal()
- Dsignal() followed by wait()
10What is the correct order of operations for protecting a critical section using a binary semaphore?
- Arelease() followed by acquire()
- Bacquire() followed by release()
- Cwait() followed by signal()
- Dsignal() followed by wait()
11_____ is not a technique for handling critical sections in operating systems.
- ANonpreemptive kernels
- BPreemptive kernels
- CSpinlocks
- DPeterson's solution
12A solution to the critical section problem does not have to satisfy which of the following requirements?
- Amutual exclusion
- Bprogress
- Catomicity
- Dbounded waiting
13A(n) _______ refers to where a process is accessing/updating shared data.
- Acritical section
- Bentry section
- Cmutex
- Dtest-and-set
14_____ can be used to prevent busy waiting when implementing a semaphore.
- ASpinlocks
- BWaiting queues
- CMutex lock
- DAllowing the wait() operation to succeed
15Assume an adaptive mutex is used for accessing shared data on a Solaris system with multiprocessing capabilities. Which of the following statements is not true?
- AA waiting thread may spin while waiting for the lock to become available.
- BA waiting thread may sleep while waiting for the lock to become available.
- CThe adaptive mutex is only used to protect short segments of code.
- DCondition variables and semaphores are never used in place of an adaptive mutex.
16What is the purpose of the mutex semaphore in the implementation of the bounded-buffer problem using semaphores?
- AIt indicates the number of empty slots in the buffer.
- BIt indicates the number of occupied slots in the buffer.
- CIt controls access to the shared buffer.
- DIt ensures mutual exclusion.
17How many philosophers may eat simultaneously in the Dining Philosophers problem with 5 philosophers?
- A1
- B2
- C3
- D5
18Which of the following statements is true?
- AA counting semaphore can never be used as a binary semaphore.
- BA binary semaphore can never be used as a counting semaphore.
- CSpinlocks can be used to prevent busy waiting in the implementation of semaphore.
- DCounting semaphores can be used to control access to a resource with a finite number of instances.
19_____ is/are not a technique for managing critical sections in operating systems.
- APeterson's solution
- BPreemptive kernel
- CNonpreemptive kernel
- DSemaphores
20When using semaphores, a process invokes the wait() operation before accessing its critical section, followed by the signal() operation upon completion of its critical section. Consider reversing the order of these two operations—first calling signal(), then calling wait(). What would be a possible outcome of this?
- AStarvation is possible.
- BSeveral processes could be active in their critical sections at the same time.
- CMutual exclusion is still assured.
- DDeadlock is possible.
21Which of the following statements is true?
- AOperations on atomic integers do not require locking.
- BOperations on atomic integers do require additional locking.
- CLinux only provides the atomic_inc() and atomic_sub() operations.
- DOperations on atomic integers can be interrupted.
22A(n) ___________ is a sequence of read-write operations that are atomic.
- Aatomic integer
- Bsemaphore
- Cmemory transaction
- Dmutex lock
23The OpenMP #pragma omp critical directive ___________.
- Abehaves much like a mutex lock
- Bdoes not require programmers to identify critical sections
- Cdoes not guarantee prevention of race conditions
- Dis similar to functional languages
24Another problem related to deadlocks is ____________.
- Arace conditions
- Bcritical sections
- Cspinlocks
- Dindefinite blocking
Information
- Description
- Quiz on os 6, created by Adam Whiteside on 24/04/2019.
- Author
- Adam Whiteside
- Language
- English
- Views
- 66
- Rating
- No ratings yet Rate this quiz