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
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am