A semaphore is a shared integer variable __________

2024

A semaphore is a shared integer variable __________

  1. A.

    that can not drop below zero

  2. B.

    that can not be more than zero

  3. C.

    that can not drop below one

  4. D.

    that can not be more than one

Attempted by 130 students.

Show answer & explanation

Correct answer: A

Answer: a

Explanation: A semaphore is a shared integer variable that can not drop below zero. In binary semaphore, if the value of the semaphore variable is zero that means there is a process that uses a critical resource and no other process can access the same critical resource until it is released. In Counting semaphore, if the value of the semaphore variable is zero that means there is no resource available.

Explore the full course: Computer Science