Skip to content

error in memory model description #159

Closed
@cyb70289

Description

@cyb70289

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 确保了它之后的读写行为,不会发生在该获取操作之前,是一个向后的屏障。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions