Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given below is the code of three processes P1, P2 and P3 running simultaneously in a computer system. Processes use two shared binaries semaphores, s1
Given below is the code of three processes P1, P2 and P3 running simultaneously in a computer system. Processes use two shared binaries semaphores, s1 and s2 initialized to 1 and 0, respectively
After all three processes have finished executing, which of the following strings can NOT be printed? a) The string 'yxz' b) The string 'yzx' c) The string 'zyx' d) The string 'zxy'
semaphore: s1=1,s2=0; \begin{tabular}{l|l|l} \hline \multicolumn{1}{c|}{P1} & P2 & P3 \\ wait(s2); & wait(s1); & wait(s1); \\ wait(s1); & print(''y'); & print(''z'); \\ print((x);signal(s1); & signal(s1); & signal(s1); \\ signal(s2); & \\ \hline \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started