Only do question 3
do { } flag = true; turn = i; while (flag[j] && turn Critical section flag = FALSE; Remainder section = j);
Question 3. [Points 4] Three processes P1, P2, and P3 are sharing a resource R1 in a mutually exclusive manner. Using compare_and_swap instruction, show code for P1, P2, and P3 that shows the entry section and exit section (similar to the code shown in Question 1). Using this code, show a scenario if all three processes want to enter their critical sections.
Only do question 3
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Only do question 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!