Skip to content

Commit

Permalink
Update 17-20 C++11内存模型同步模式.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddliu authored Mar 25, 2021
1 parent 30b8209 commit 42dc4d9
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions 2017/11/17-20 C++11内存模型同步模式.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

绝大数人们在研究内存模型的时候都发现这个领域非常令人困惑。__原子变量主要被用来在线程之间同步共享内存访问。__ 一般的一个线程船舰了数据,然后存储到一个原子变量中。其他的线程读取这个原子变量,并且在读取到期望值的时候,这个被其他线程创建的值在当前线程可见了。不同的内存模型模式用来表示线程之间这种数据共享的联系有多强。富有经验的程序员们能够利用其中较弱的模型使软件更加高效。

Each atomic class has a load() and a store() operation which is utilized to perform assignments. This helps make it clearer when atomic operations are being performed rather than a normal assignment.

每一个原子类都有一个`load()`和执行赋值的`store()`操作。这使得执行原子操作比普通赋值更加清晰。
```cpp
atomic_var1.store(atomic_var2.load()); // atomic variables
Expand Down

0 comments on commit 42dc4d9

Please sign in to comment.