478 views
0 votes
0 votes
after execution of 15p and 18 v operations semaphore value is same as execution of  

A. 3P                                   C.12P&15V

B.3V                                    C. Both B&C

 

what is the solution

1 Answer

1 votes
1 votes
Say initial value of Semaphore S is q.

Now after 15 P ...q-15 is new value , after 18 V we have q-15+18=q+3.

Now option A) 3P is q-3 ...so wrong

Option B) 12P so q -12 is new value and after 15V we have q-12+15 that is q+ 3 so correct

Option C) 3V that is q+3 so

OPTION B AND C both are correct ..