线程中的每个动作都发生在该线程中按程序顺序稍后出现的每个动作之前
Each action in a thread happens-before every action in that thread that comes later in the program's order
Memory Consistency Properties的第一个要点是:
- Each action in a thread happens-before every action in that thread that comes later in the program's order.
我想这是对 Java 内存模型的一个相对较新的补充,因为 Jon Skeet didn't mention it in 2011。
这个要点在实践中究竟意味着什么?我很难理解它。它只是意味着 "There are no concurrency issues within a single thread" 吗?或者还有更多?
What exactly does this bullet point mean in practice?
线程中的所有事情理论上都按照程序执行的顺序发生(实际上,指令可以重新排序以使程序 运行 更快)
I'm having a hard time making sense of it.
很可能你想多了。想象一下,您正在阅读一首歌的歌词。每行中的词都发生在它之前的所有词之后,该行之后的所有词都发生在它之后。
Does it simply mean "There are no concurrency issues within a single thread"?
是的,不应该,但可以。例如Spectre 和 Meltdown 安全问题就是利用了这一点。
Memory Consistency Properties的第一个要点是:
- Each action in a thread happens-before every action in that thread that comes later in the program's order.
我想这是对 Java 内存模型的一个相对较新的补充,因为 Jon Skeet didn't mention it in 2011。
这个要点在实践中究竟意味着什么?我很难理解它。它只是意味着 "There are no concurrency issues within a single thread" 吗?或者还有更多?
What exactly does this bullet point mean in practice?
线程中的所有事情理论上都按照程序执行的顺序发生(实际上,指令可以重新排序以使程序 运行 更快)
I'm having a hard time making sense of it.
很可能你想多了。想象一下,您正在阅读一首歌的歌词。每行中的词都发生在它之前的所有词之后,该行之后的所有词都发生在它之后。
Does it simply mean "There are no concurrency issues within a single thread"?
是的,不应该,但可以。例如Spectre 和 Meltdown 安全问题就是利用了这一点。