Intermediate Operating Systems
Q42 / 100

What is the difference between a binary semaphore and a counting semaphore?

Correct! Well done.

Incorrect.

The correct answer is B) Binary semaphore has value 0 or 1 (mutex-like); counting semaphore can have any non-negative value (managing a resource pool)

B

Correct Answer

Binary semaphore has value 0 or 1 (mutex-like); counting semaphore can have any non-negative value (managing a resource pool)

Explanation

Binary semaphore: 0 (locked) or 1 (unlocked). Counting semaphore: tracks a resource count (e.g., available buffer slots in producer-consumer). Signal increments; Wait decrements.

Progress
42/100