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
0
Answer:
the code will be
Explanation:
P1P2P1P2P1P2P1P2P1P2P1P2PP22PP11PP22PP11PPP111PPP222 ….. SO ON
Similar questions
History,
4 months ago
Hindi,
8 months ago
Math,
11 months ago
CBSE BOARD XII,
11 months ago
Hindi,
11 months ago