Page 1 of 1

Q2. (5 pts) Consider 3 concurrent processes P1, P2, P3 as in the following table. S1, S2, and S3 are semaphores all init

Posted: Mon Jun 06, 2022 1:57 pm
by answerhappygod
Q2 5 Pts Consider 3 Concurrent Processes P1 P2 P3 As In The Following Table S1 S2 And S3 Are Semaphores All Init 1
Q2 5 Pts Consider 3 Concurrent Processes P1 P2 P3 As In The Following Table S1 S2 And S3 Are Semaphores All Init 1 (34.13 KiB) Viewed 40 times
Q2. (5 pts) Consider 3 concurrent processes P1, P2, P3 as in the following table. S1, S2, and S3 are semaphores all initialized to 0. What are the possible outputs of this concurrent execution? For every answer you provide, show your work including possible intermediate values for S1, S2, and S3. Make any assumptions you see necessary but clearly state them. P1 P2 P3 for (int i=0; i<2; i++) for (int i=0; i<2; i++) for (int i=0; i<2; i++) { { { Print "X"; Print "Y"; wait (S3); signal (S3); signal (S3); wait (S3); Print "Z"; wait (S1); wait(S2); signal (S2); signal (S1);