问题
This example comes from 64-IA-32 Architectures Software Developers Manual.
And I cannot understand why store of CPU #0 must be visible for other processors? In that concrete example ( when r1 = 1, r2 = 1) I agree that it is obvious that store made by CPU #0 must be retired firstly- I mean the 1 value must be in memory/cache in fact ( not in store buffer).
But what about general case? Is it possible the following situation:
CPU#0 stored: mov [_x], 1
but it was stored in CPU#0's store buffer
, and then CPU#1 loaded: mov r1, [_x]
and in fact, r1
is equal to 0?
来源:https://stackoverflow.com/questions/38331975/memory-ordering-two-processors