Computer Science, asked by shravaniv2104, 8 months ago

Consider the following scenario and suggest an appropriate synchronization mechanism using semaphores. Two processes P1 and P2 share a resource in critical section. P1 always enter critical section first regardless of runtime order. P1 enters critical section two times consecutively, then only P2 is allowed. P2 enters critical section once and then P1 is allowed. Sample run —> P1 P1 P2 P1 P1 P2 P1 P1 P2 . . . continues

Answers

Answered by DEV00798
0

Answer:

the code will be

Explanation:

P1P2P1P2P1P2P1P2P1P2P1P2PP22PP11PP22PP11PPP111PPP222 ….. SO ON

Similar questions