Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬,能不能提个问题。。 #45

Open
SiriusQiu opened this issue Jul 26, 2020 · 1 comment
Open

大佬,能不能提个问题。。 #45

SiriusQiu opened this issue Jul 26, 2020 · 1 comment

Comments

@SiriusQiu
Copy link

@SiriusQiu SiriusQiu commented Jul 26, 2020

大佬问个问题。。。《java并发编程的艺术》里读到一句话:“当写一个volatile变量时,JMM会把该线程对应的本地内存的共享变量刷新到主内存”。这边的共享变量,是指被volatile修饰的共享变量,还是指该线程所有改动后的共享变量。

@SiriusQiu
Copy link
Author

@SiriusQiu SiriusQiu commented Jul 26, 2020

volatile的写指令后有一个storeload内存屏障,storeload:store1;StoreLoad;load2;在load2及之后要读取的数据被访问之前,保证store1的写入对所有处理器可见。所以只保证store1可见是吗,store1之前的store指令是否保证可见呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.