The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+8 votes

A counting semaphore was initialized to $10$. Then $6 P$ (wait) operations and $4V$ (signal) operations were completed on this semaphore. The resulting value of the semaphore is

  1. $0$
  2. $8$
  3. $10$
  4. $12$
asked in Operating System by Veteran (59.6k points)
edited by | 2.8k views

2 Answers

+19 votes
Best answer

Answer is option (B)

Initially semaphore is $10$, then $6$ down operations are performed means $(10-6=4)$ and $4$ up operations means $(4+4=8)$

So, at last option (B) $8$ is correct.

answered by Active (3.3k points)
edited by
+3 votes
6 down and 4 up

that mean we are left with 2 down

and the total is 10 reduce 2 down from it

ans 8
answered by Junior (957 points)

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

41,055 questions
47,654 answers
62,380 users