Which of the following statement is true about semaphore? Statements: I. It…

2021

Which of the following statement is true about semaphore? Statements: I. It can be implemented using software II. It can be implemented using hardware

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 303 students.

Show answer & explanation

Correct answer: C

Option 3: Both I and II

Semaphores are highly versatile and can be implemented through various means:

  1. Software Implementation: Algorithms like Dijkstra's original semaphore operations ($P$ and $V$) can be implemented entirely in software logic within the operating system kernel.

  2. Hardware Implementation: Modern systems often use hardware-level atomic instructions, such as Test-and-Set or Compare-and-Swap, to implement semaphores efficiently and ensure that the increment/decrement operations are uninterrupted.

Explore the full course: Up Lt Grade Assistant Teacher 2025