Skip to content

error in memory model description #159

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

Closed
cyb70289 opened this issue Dec 22, 2020 · 1 comment
Closed

error in memory model description #159

cyb70289 opened this issue Dec 22, 2020 · 1 comment
Labels

Comments

@cyb70289
Copy link

cyb70289 commented Dec 22, 2020

Actual Description

wrong description of release and acquire memory order behaviour

  • File path: book/en-us/07-thread.md
  • Original text:
As you can see, std::memory_order_release ensures that the write behavior after it does not occur before the release operation, which is a backward barrier, andstd::memory_order_acquire ensures that its previous write behavior does not occur after this acquisition operation, there is a forward barrier. 

Expected

As you can see, std::memory_order_release ensures that the load/store before it does not occur after the release operation, which is a forward barrier, and std::memory_order_acquire ensures that load/store after it does not occur before this acquisition operation, that is a backward barrier. 

实际描述

release, acquire memory order的行为描述反了

  • 文件路径:book/zh-cn/07-thread.md
  • 原文段落:
可以看到,std::memory_order_release 确保了它之后的写行为不会发生在释放操作之前,是一个向后的屏障,而 std::memory_order_acquire 确保了它之前的写行为,不会发生在该获取操作之后,是一个向前的屏障。

预期描述

可以看到,std::memory_order_release 确保了它之前的读写行为不会发生在释放操作之后,是一个向前的屏障,而 std::memory_order_acquire 确保了它之后的读写行为,不会发生在该获取操作之前,是一个向后的屏障。
@changkun
Copy link
Owner

PR welcome

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

No branches or pull requests

2 participants