Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Contrast variables that increase helping and aggressive behavior.

Answered: 1 week ago

Question

Technology. Refer to Case

Answered: 1 week ago