Which of the following statement is correct regarding semaphore:

  1. Up operation is always successful and independent of initial semaphore count in case of counting semaphore.
  2. Down operation is unsuccessful operation if the initial count of counting semaphore greater than zero.
  3. Preemption is possible within the up and down operation’s statement.

(A) All statements are correct

(B) Statement 1 and statement 3
(C) Statement 2 and statement 3
(D) All statements are incorrect.


Answer: (D)

Explanation: All given statements are false.

  1. Up operation is always successful and dependent of initial semaphore count in case of counting semaphore or binary semaphore when the initial value of the semaphore is less than equal to 0 then it will pick a process from suspended list and wakeup();
  2. Down operation is unsuccessful if the initial count of the semaphore is less then 0.
  3. All statements in up and down operation are atomic. No preemption is possible.

So, option (D) is correct.

Quiz of this Question


  • Last Updated : 30 Oct, 2018

Share your thoughts in the comments