← Back to 5. Process Synchronization

📝 Semaphores

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

Practice MCQs for Semaphores. Test your knowledge with carefully crafted questions across easy, medium, and hard difficulty levels.

🔄 Last updated: 2026-07-09

25
Easy Questions
19
Medium Questions
6
Hard Questions

📝 Sample Questions

Q1. What is a semaphore in the context of process synchronization?

🔹 A. A hardware register.
🔹 B. An integer variable accessed only through atomic operations.
🔹 C. A boolean flag for mutual exclusion.
🔹 D. A queue of waiting processes.

💡 Difficulty: easy | ✅ Correct: B

Q2. What is a critical requirement for the `wait()` and `signal()` operations on a semaphore?

🔹 A. They must be executed in user mode.
🔹 B. They must be executed atomically.
🔹 C. They must be called in pairs.
🔹 D. They must be called from the same process.

💡 Difficulty: medium | ✅ Correct: B

Q3. What is the effect of executing `wait(S)` on a semaphore with value 0?

🔹 A. The semaphore value becomes -1.
🔹 B. The semaphore value becomes 1.
🔹 C. The process busy-waits and the semaphore value remains 0 until it becomes positive.
🔹 D. The semaphore value becomes 0.

💡 Difficulty: hard | ✅ Correct: C

⬆️ 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