I wanted to know that if while using ll/sc there is a change in processor before the sc statement is executed what would be result.
E.g.
CPU 1 ==> $t1 = 1, $t0 = 2
CPU 2 ==> $t1 = 30, $t0 = 40
MEMORY ==> $s0 = 99
If we execute these statements:
Code:
ll $t1, 0($s0) --- CPU 1
ll $t1, 0($s0) --- CPU 2
addi $t1, $t1, 1 --- CPU 2
sc $t1, 0($s0) --- CPU 2 ($t1 = 1, $s0 = 100)
sc $t0, 0($s0) --- CPU 1
I know that after the execution (Correct me if I am wrong):
CPU 2 ==> $t1 = 1, $t0 = 40
CPU 1 ==> $t1 = 99
I don't know what will happen to $s0 and $t0 after the CPU 1 command. Will $s0 = 2 ??