Question 18
Assuming context switches can occur at any time during the execution of the following code snippet, counter is a shared variable. Which of the following can be the possible final values of the counter variable?
# Program 0counter = 5R1 = counterR1 = R1 + 2counter = R1
# Program 1R2 = counterR2 = R2 - 2counter = R24
6
5
3
7
8