177 views
0 votes
0 votes
the semaphore variable full,empty,and mutex are 0,n,1 respectively.process p1 adds one item at a time and p2 removes one item at a time from the same buffer.in the program ,K,L,M,N.

P1:while(1)

{

k;p(mutex);

add an item to the buffer;

v(mutex);L;

}

p2:while(1)

{

M;p(mutex);

remove an item to the buffer

v(mutex);N;

}

answer is P(empty),V(full),P(fulll),V(empty) how???????

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
roopkathaaa asked Aug 25, 2023
1,276 views
In a certain application, the initial value of a counting semaphore s is 10. The following operations were completed on the semaphore in the given order 5P, 20P, 2V, 18P,...
0 votes
0 votes
0 answers
4
Arbaz__Malik asked Dec 25, 2021
635 views
given solution is wait(P) , wait(Q), wait(p) , wait(Q) for s1,s2,s3,s4 respectivelyI know this implementation is deadlock free just want to ask if it will follow bounded ...