What/Where 是物理设备上的线程工作副本
What/Where is Thread Working Copy on physical device
来自java specification:
Every thread has a working memory in which it keeps its own working copy of variables that it must use or assign. As the thread executes a program, it operates on these working copies. The main memory contains the master copy of every variable. There are rules about when a thread is permitted or required to transfer the contents of its working copy of a variable into the master copy or vice versa.
What/Where 是“线程工作副本”?他们指的是 CPU 缓存还是 RAM?
我困惑的原因:
For the purposes of this chapter, the verbs use, assign, load, store, lock, and unlock name actions that a thread can perform. The verbs read, write, lock, and unlock name actions that the main memory subsystem can perform.
他们是否使用汇编代码引用这些指令?
注意:我知道规范是旧的,我将这个问题标记为 Java14。我这样做是因为构造仍然成立。
编辑:
我创建了下面的图片,是否正确?
我是这么理解的。下图如有错误请评论:
“工作副本”是一种逻辑结构,而不是物理结构。
每个线程的完整数据将在 RAM 中找到,部分数据可能会或可能不会作为副本存在于 CPU 缓存中,具体取决于 CPU 上次需要它们的时间。
来自java specification:
Every thread has a working memory in which it keeps its own working copy of variables that it must use or assign. As the thread executes a program, it operates on these working copies. The main memory contains the master copy of every variable. There are rules about when a thread is permitted or required to transfer the contents of its working copy of a variable into the master copy or vice versa.
What/Where 是“线程工作副本”?他们指的是 CPU 缓存还是 RAM?
我困惑的原因:
For the purposes of this chapter, the verbs use, assign, load, store, lock, and unlock name actions that a thread can perform. The verbs read, write, lock, and unlock name actions that the main memory subsystem can perform.
他们是否使用汇编代码引用这些指令?
注意:我知道规范是旧的,我将这个问题标记为 Java14。我这样做是因为构造仍然成立。
编辑:
我创建了下面的图片,是否正确?
我是这么理解的。下图如有错误请评论:
“工作副本”是一种逻辑结构,而不是物理结构。
每个线程的完整数据将在 RAM 中找到,部分数据可能会或可能不会作为副本存在于 CPU 缓存中,具体取决于 CPU 上次需要它们的时间。