quiz

Synchronization in Operating System

1. Which synchronization mechanism is commonly used to enforce mutual exclusion?

  • A) Semaphore
  • B) Condition Variable
  • C) Barrier
  • D) Shared Memory
A) Semaphore Explanation

2. What is another term for the bounded buffer problem in synchronization?

  • A) Dining Philosophers
  • B) Readers-Writers
  • C) Producer-consumer problem
  • D) Mutex challenge
C) Producer-consumer problem Explanation

3. What is a spin lock in synchronization?

  • A) A lock that polls indefinitely, wasting CPU cycles
  • B) A lock that waits in a sleep state until it can be acquired
  • C) A deadlock 
  • D) A blocked process
A) A lock that polls indefinitely, wasting CPU cycles Explanation

4. What type of semaphore allows only one thread or process to access a section at a time?

  • A) Counting semaphore
  • B) Binary semaphore
  • C) Both A and B
  • D) None of these
B) Binary semaphore Explanation

5. What is the purpose of a barrier in thread synchronization?

  • A) To prevent race conditions in critical sections
  • B) To allow multiple threads to execute simultaneously
  • C) To coordinate the progress of multiple threads at specific points
  • D) To introduce priority inversion between threads
C) To coordinate the progress of multiple threads at specific points Explanation