3 ms·
About half way down the article, the author says this: > Under this relaxed definition, we find that we cannot establish a total > order over all memory_order:
by alextingle 1y ago
About half way down the article, the author says this:
> Under this relaxed definition, we find that we cannot establish a total
> order over all memory_order::seq_cst operations due to a cycle in the graph:
> (2) -> (4) -> (6) -> (7) -> (2).
I don't understand why they say that "(2) -> (4)". (2) must certainly come before (3) in the context of threads 1 & 3, which both refer to X and Y. But thread 2 knows nothing about X, so AFAIK accesses to X can be arbitrarily reordered from the perspective of thread 2 - if "reordering" can even be said to have any meaning at all in a thread that knows nothing about X.