in Operating System edited by
13,508 views
5 votes
5 votes

At a particular time the value of counting semaphore is 10. It will become 7 after:

  1. 3 V operations
  2. 3 P operations
  3. 5 V operations and 2 P operations
  4. 2 V operations and 5 P operations
in Operating System edited by
by
13.5k views

1 comment

Were we supposed to circle both B and D ??
0
0

2 Answers

13 votes
13 votes
Best answer
We know that there are two operations are used in semaphores

1) wait : It is denoted by P, It is used when some process enter into the critical section by decreasing semaphore value by 1.

2) signal :It is denoted by V, It is used when some process exit into the critical section by increasing semaphore value by 1.

So, in the question they are asking about value is decreasing from 10 to 7 so, there would be 3 P operations used..

And other possibility may be firstly 2 V happen, because of this value increases from 10 to 12 and then 5 P happen, because of this value decreases from 12 to 7..

so both B and D will be correct...
selected by

4 Comments

I hope all the PSUs stop their exams and only recruit via GATE. And also hope GATE is conducted twice a year soon.
11
11

@sonam vyas

And Made easy took it from Timothy j Williams book  , see question number 21 .

options given there both B and C .

2
2

it is mentioned that, "at particular time", not initialized with. So, i think both B and D are correct.

1
1
0 votes
0 votes
Option B,D both will give same answer
Answer:

Related questions