My doubt is not the CPU thread scheduling unit, CPU executes, not is the thread of execution, so why CPU cache will get main memory data, mainly want to know about the CPU cache relationship with the working memory?
CodePudding user response:
Can look at this article http://tutorials.jenkov.com/java-concurrency/java-memory-model.htmlCodePudding user response:
You are concerned about the thread in the relationship between the process and the main memory stack memory, CPU cache mechanism is that the operating system level, personal understanding the JVM does not directly involved, as the kernel memory space and user mode memory space, the JVM can only operate user mode memory, kernel memory to the user states are OS processingThread stack will be determined according to the violarity keyword how to get data from the master copy of this part of the data only guarantee thread at a time when the get the latest, when does not guarantee thread safety, if you want to need thread safety lock, or use copyonwriteList/Array container, this will be used when writing copy mechanism security thread to get the latest data, and improve the I/o throughput
I wonder if you'd like to know when this, or do you want to know about the details of the Linux memory
CodePudding user response:
Integration of CPU cache in a CPU, cache just a faster memory, the CPU is automatic storage of main memory cache, generally no instruction available control cacheCPU executes instructions, only for CPU, no thread this stuff, thread is operating system concept, and managed by the operating system, operating system interface to create threads, allocation of CPU resources, the thread of execution,
CPU storage management found a section of main memory used frequently, the cache to chip in the cache, CPU cache for programmers are not visible,