为什么这个输出是错误的? - 顺序一致性

Why is this output wrong ? - Sequential Consistency

按照我对顺序一致性模型的理解,标记为错误的输出应该是有效的,我错过了什么?

如果我们查看 wiki 中的 definition of sequential consistency,我们会看到:

the result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor appear in this sequence in the order specified by its program

在您的示例中,违反了 P2 进程的顺序,因为 print (x,z) 操作先于 y=1