edited by
13,466 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
edited by

2 Answers

Best answer
13 votes
13 votes
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
Answer:

Related questions

7 votes
7 votes
2 answers
1
sh!va asked May 7, 2017
6,411 views
Which of the following statement is true?Hard real time OS has less jitter than soft real time OSHard real time OS has more jitter than soft real time OSHard real time OS...
5 votes
5 votes
1 answer
2
sh!va asked May 7, 2017
7,444 views
The Linux command mknod myfifo b 4 16will create a character device if user is rootwill create a named pipe FIFO if user is rootwill create a block device if user is root...
6 votes
6 votes
4 answers
3
sh!va asked May 7, 2017
5,452 views
A critical regionis a piece of code which only one process executes at a timeis a region prone to deadlockis a piece of code which only a finite number of processes execu...