COS3721 Chapter 6 Exam Questions And
Answers 100% Verified And Updated.
1. A race condition ____.
A) results when several threads try to access the same data concurrently
B) results when several threads try to access and modify the same data concurrently
C) will result only if the outcome of execution does not depend on the order in which
instructions are executed
D) None of the above - Answer✔B
2. An instruction that executes atomically ____.
A) must consist of only one machine instruction
B) executes as a single, uninterruptible unit
C) cannot be used to solve the critical section problem
D) All of the above - Answer✔B
3. A counting semaphore ____.
A) is essentially an integer variable
B) is accessed through only one standard operation
C) can be modified simultaneously by multiple threads
D) cannot be used to control access to a thread's critical sections - Answer✔A
4. A mutex lock ____.
A) is exactly like a counting semaphore
B) is essentially a boolean variable
C) is not guaranteed to be atomic
D) can be used to eliminate busy waiting - Answer✔B
5. In Peterson's solution, the ____ variable indicates if a process is ready to enter its critical
section.
1|Page
, ©FYNDLAY 2024/2025 ALL RIGHTS RESERVED.
A) turn B) lock
C) flag[i] D) turn[i] - Answer✔C
6. The first readers-writers problem ____.
A) requires that, once a writer is ready, that writer performs its write as soon as possible.
B) is not used to test synchronization primitives.
C) requires that no reader will be kept waiting unless a writer has already obtained permission to
use the shared database.
D) requires that no reader will be kept waiting unless a reader has already obtained permission to
use the shared database. - Answer✔C
7. A ___ type presents a set of programmer-defined operations that are provided mutual
exclusion within it.
A) transaction B) signal
C) binary D) monitor - Answer✔D
8. ____________ occurs when a higher-priority process needs to access a data structure that is
currently being accessed by a
lower-priority process.
A) Priority inversion
B) Deadlock
C) A race condition
D) A critical section - Answer✔A
9. What is the correct order of operations for protecting a critical section using mutex locks?
A) release() followed by acquire()
B) acquire() followed by release()
C) wait() followed by signal()
D) signal() followed by wait() - Answer✔B
10. What is the correct order of operations for protecting a critical section using a binary
semaphore?
A) release() followed by acquire()
B) acquire() followed by release()
C) wait() followed by signal()
D) signal() followed by wait() - Answer✔C
2|Page