Skip to content

Commit ea207e8

Browse files
committed
Fix a bug in description of data races with scopes
The previously proposed wording suggested that any difference in scopes would lead to undefined behavior, which was inconsistent with the paragraph immediately afterwards about which atomics synchronize-with each other.
1 parent 0665b69 commit ea207e8

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

adoc/chapters/architecture.adoc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,14 +1096,23 @@ programming and to provide a meaningful way to describe the behavior of
10961096
<<group,groups>> containing a single work-item.
10971097
{endnote}
10981098

1099-
Potentially concurrent conflicting actions with different memory scopes are
1100-
considered a data race, resulting in undefined behavior.
1099+
Potentially concurrent conflicting actions with different memory scopes may
1100+
lead to a data race, resulting in undefined behavior.
1101+
An atomic operation _A_ with scope _S~1~_ operating on the same memory location
1102+
as atomic operation _B_ with scope _S~2~_ is a data race if:
1103+
1104+
* The work-items which executed _A_ and _B_ are not both in the same group of
1105+
work-items associated with scope _S~1~_; and
1106+
* The work-items which executed _A_ and _B_ are not both in the same group of
1107+
work-items associated with scope _S~2~_.
11011108

11021109
An atomic operation _A_ with scope _S~1~_ can only synchronize with another
11031110
atomic operation _B_ with scope _S~2~_ if:
11041111

1105-
* The work-item which executed _A_ is in both _S~1~_ and _S~2~_; and
1106-
* The work-item which executed _B_ is in both _S~1~_ and _S~2~_.
1112+
* The work-items which executed _A_ and _B_ are both in the same group of
1113+
work-items associated with scope _S~1~_; and
1114+
* The work-items which executed _A_ and _B_ are both in the same group of
1115+
work-items associated with scope _S~2~_.
11071116

11081117
The memory scopes are listed above from narrowest
11091118
([code]#memory_scope::work_item#) to widest ([code]#memory_scope::system#).

0 commit comments

Comments
 (0)