Q2. (5 pts) Consider 3 concurrent processes P1, P2, P3 as in the following table. S1, S2, and S3 are semaphores all init
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Q2. (5 pts) Consider 3 concurrent processes P1, P2, P3 as in the following table. S1, S2, and S3 are semaphores all init
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);
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!