The two variables a and b have initial values of 1 and 2, respectively. The following code is for a Linux system:
Thread 1 | Thread 2 |
a = 3; | – |
mb(); | – |
b = 4 | c = b; |
– | rmb(); |
– | d = a; |
What possible errors are avoided by the use of the memory barriers?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.