← Back to 5. Process Synchronization

📝 Deadlocks and Starvation in Semaphore

📖 From Operating System • 5. Process Synchronization • 52 questions available

Practice MCQs for Deadlocks and Starvation in Semaphore. Test your knowledge with carefully crafted questions across easy, medium, and hard difficulty levels.

🔄 Last updated: 2026-07-09

16
Easy Questions
25
Medium Questions
11
Hard Questions

📝 Sample Questions

Q1. What is a deadlock in the context of semaphores?

🔹 A. A situation where a process terminates unexpectedly.
🔹 B. A situation where two or more processes are waiting indefinitely for an event that can be caused only by one of the waiting processes.
🔹 C. A situation where a process is blocked due to busy waiting.
🔹 D. A situation where the semaphore value becomes negative.

💡 Difficulty: easy | ✅ Correct: B

Q2. In the classic deadlock example, what are the two semaphores initialized to?

🔹 A. 0
🔹 B. 1
🔹 C. -1
🔹 D. 2

💡 Difficulty: medium | ✅ Correct: B

Q3. In the deadlock example with processes P0 and P1, what sequence of operations leads to deadlock?

🔹 A. P0 executes wait(Q), P1 executes wait(S), P0 executes wait(S), P1 executes wait(Q).
🔹 B. P0 executes wait(S), P1 executes wait(Q), P0 executes wait(Q), P1 executes wait(S).
🔹 C. P0 executes signal(S), P1 executes signal(Q).
🔹 D. P0 executes wait(S), P1 executes signal(Q).

💡 Difficulty: hard | ✅ Correct: B

⬆️ View all questions in the quiz below

🔗 Related Topics

📝 Computer System Architecture📝 Computer System Organization📝 Computing Environments📝 Kernel Data Structures📝 Memory Management
🚀 Start Quiz 📝 Practice Mode