what is value of x for load and store
- by Kevinniceguy
This is some challenge
On a single processor system, in which load and store are assumed to be
atomic, what are all the possible values for x after both threads have completed in
the following execution, assuming that x is initialised to O? Hint: you need to
consider how this code might be compiled into machine language.
for (int i = 0; i < 5; i++) :
x = x + 1;
for (int j = 0; j < 5; j++) :
x = x + 1;