← All topics
Quiz: Process Synchronization: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Two threads update a shared counter and one update is lost. This is a:
- Q2. Which is NOT a requirement of a critical-section solution?
- Q3. A counting semaphore initialised to 3 controls access to:
- Q4. What does signal(S) do?
- Q5. Key difference between a mutex and a semaphore?
- Q6. A semaphore S starts at 2. Three processes call wait(S) one after another, and nobody calls signal(S). What happens?
- Q7. In the producer–consumer solution, when does the producer block on wait(empty)?
- Q8. In the readers–writers problem, which access pattern is allowed?
- Q9. In the dining philosophers problem, how does making one philosopher pick up the right fork first prevent deadlock?
- Q10. Why is it a bad idea to hold a lock while doing slow I/O such as reading a file?