Multiple choice technology operating systems

22 What is a semaphore

  1. 1 A mechanism to share non-sharable resources

  2. 2 A mechanism to access memory very fast

  3. 3 A mechanism to access kernel details

  4. 4 None

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A semaphore is a synchronization mechanism used to control access to shared, non-sharable resources in concurrent systems. It maintains a counter and uses wait (P) and signal (V) operations to coordinate process access, preventing race conditions. It is not related to fast memory access or kernel details.

AI explanation

A semaphore is a synchronization primitive used to control access to a resource that can't safely be used by multiple processes/threads simultaneously (a non-sharable resource), by tracking how many 'permits' are available and blocking requesters when none remain. It's not about speeding up memory access or exposing kernel internals — those aren't what semaphores are designed for.