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

typo #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

typo #28

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

在多线程条件下,多个线程肯定会相互协作完成一件事情,一般来说就会涉及到**多个线程间相互通信告知彼此的状态以及当前的执行结果**等,另外,为了性能优化,还会**涉及到编译器指令重排序和处理器指令重排序**。下面会一一来聊聊这些知识。

#2. 内存模型抽象结构
# 2. 内存模型抽象结构 #
线程间协作通信可以类比人与人之间的协作的方式,在现实生活中,之前网上有个流行语“你妈喊你回家吃饭了”,就以这个生活场景为例,小明在外面玩耍,小明妈妈在家里做饭,做晚饭后准备叫小明回家吃饭,那么就存在两种方式:

小明妈妈要去上班了十分紧急这个时候手机又没有电了,于是就在桌子上贴了一张纸条“饭做好了,放在...”小明回家后看到纸条如愿吃到妈妈做的饭菜,那么,如果将小明妈妈和小明作为两个线程,那么这张纸条就是这两个线程间通信的共享变量,通过读写共享变量实现两个线程间协作;
Expand Down Expand Up @@ -142,4 +142,4 @@ JMM的设计图为:

> 参考文献

《java并发编程的艺术》
《java并发编程的艺术》