293 views
0 votes
0 votes
Counting Semaphores value is initialized to 1 and no blocked processes are present in the system. If the following operations are performed in the given order then what is the final value of S:  P,V,P,V,V,P,P,V,V,V,P,V,V,V,P,P,V,V?

Doubt 1: Shouldn’t the final value be 1 after successive P operations put a process in blocked state and V operations unblock processes if a process is waiting?

Doubt 2: What happens if value is already 1 and successive V operations are performed?

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
Mrityudoot asked Jan 27
178 views
Can a counting semaphore acquire a negative value?S = 2;15 P operations done, should the semaphore be 0 or -13
1 votes
1 votes
1 answer
4