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

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.5k points)
edited by | 2.7k views

2 Answers

+18 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

37,940 questions
45,453 answers
131,195 comments
48,209 users