You could consider these "thread-local" copies of variables to be similar to a cache, helping the thread avoid checking main memory each time it needs to access the variable's value.
您可以将变量的这些“线程局部”副本看作是与缓存类似,在每次线程需要访问变量的值时帮助它避免检查主存储器。
When a thread exits a synchronized block as part of releasing the associated monitor, the JMM requires that the local processor cache be flushed to main memory.
当线程为释放相关监视器而退出一个同步块时,J MM要求本地处理器缓冲刷新到主存中。
Every thread in an application requires memory to hold its stack (the area of memory used to hold local variables and maintain state when calling functions).
应用程序中的每个线程都需要内存来保存它的栈(用于在调用函数时保存本地变量和维持状态的内存区)。
应用推荐