From Jason Turner

[atomics.fences]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpady73bdk/{from.md → to.md} +49 -26
tmp/tmpady73bdk/{from.md → to.md} RENAMED
@@ -1,46 +1,46 @@
1
  ## Fences <a id="atomics.fences">[[atomics.fences]]</a>
2
 
3
- This section introduces synchronization primitives called *fences*.
4
  Fences can have acquire semantics, release semantics, or both. A fence
5
  with acquire semantics is called an *acquire fence*. A fence with
6
  release semantics is called a *release fence*.
7
 
8
- A release fence *A* synchronizes with an acquire fence *B* if there
9
- exist atomic operations *X* and *Y*, both operating on some atomic
10
- object *M*, such that *A* is sequenced before *X*, *X* modifies *M*, *Y*
11
- is sequenced before *B*, and *Y* reads the value written by *X* or a
12
- value written by any side effect in the hypothetical release sequence
13
- *X* would head if it were a release operation.
14
 
15
- A release fence *A* synchronizes with an atomic operation *B* that
16
- performs an acquire operation on an atomic object *M* if there exists an
17
- atomic operation *X* such that *A* is sequenced before *X*, *X* modifies
18
- *M*, and *B* reads the value written by *X* or a value written by any
19
- side effect in the hypothetical release sequence *X* would head if it
20
- were a release operation.
21
 
22
- An atomic operation *A* that is a release operation on an atomic object
23
- *M* synchronizes with an acquire fence *B* if there exists some atomic
24
- operation *X* on *M* such that *X* is sequenced before *B* and reads the
25
- value written by *A* or a value written by any side effect in the
26
- release sequence headed by *A*.
27
 
28
  ``` cpp
29
  extern "C" void atomic_thread_fence(memory_order order) noexcept;
30
  ```
31
 
32
  *Effects:* Depending on the value of `order`, this operation:
33
 
34
- - has no effects, if `order == memory_order_relaxed`;
35
- - is an acquire fence, if
36
- `order == memory_order_acquire || order == memory_order_consume`;
37
- - is a release fence, if `order == memory_order_release`;
38
  - is both an acquire fence and a release fence, if
39
- `order == memory_order_acq_rel`;
40
  - is a sequentially consistent acquire and release fence, if
41
- `order == memory_order_seq_cst`.
42
 
43
  ``` cpp
44
  extern "C" void atomic_signal_fence(memory_order order) noexcept;
45
  ```
46
 
@@ -54,22 +54,45 @@ handler. Compiler optimizations and reorderings of loads and stores are
54
  inhibited in the same way as with `atomic_thread_fence`, but the
55
  hardware fence instructions that `atomic_thread_fence` would have
56
  inserted are not emitted. — *end note*]
57
 
58
  <!-- Link reference definitions -->
 
 
59
  [atomics]: #atomics
60
  [atomics.alias]: #atomics.alias
61
  [atomics.fences]: #atomics.fences
62
  [atomics.flag]: #atomics.flag
63
  [atomics.general]: #atomics.general
64
  [atomics.lockfree]: #atomics.lockfree
65
  [atomics.nonmembers]: #atomics.nonmembers
66
  [atomics.order]: #atomics.order
 
 
 
 
 
 
 
67
  [atomics.syn]: #atomics.syn
 
68
  [atomics.types.generic]: #atomics.types.generic
69
  [atomics.types.int]: #atomics.types.int
70
  [atomics.types.memop]: #atomics.types.memop
71
  [atomics.types.operations]: #atomics.types.operations
72
  [atomics.types.pointer]: #atomics.types.pointer
 
 
 
 
73
  [basic.types]: basic.md#basic.types
74
- [intro.multithread]: intro.md#intro.multithread
75
- [intro.progress]: intro.md#intro.progress
 
 
 
 
 
 
 
 
 
 
1
  ## Fences <a id="atomics.fences">[[atomics.fences]]</a>
2
 
3
+ This subclause introduces synchronization primitives called *fences*.
4
  Fences can have acquire semantics, release semantics, or both. A fence
5
  with acquire semantics is called an *acquire fence*. A fence with
6
  release semantics is called a *release fence*.
7
 
8
+ A release fence A synchronizes with an acquire fence B if there exist
9
+ atomic operations X and Y, both operating on some atomic object M, such
10
+ that A is sequenced before X, X modifies M, Y is sequenced before B, and
11
+ Y reads the value written by X or a value written by any side effect in
12
+ the hypothetical release sequence X would head if it were a release
13
+ operation.
14
 
15
+ A release fence A synchronizes with an atomic operation B that performs
16
+ an acquire operation on an atomic object M if there exists an atomic
17
+ operation X such that A is sequenced before X, X modifies M, and B reads
18
+ the value written by X or a value written by any side effect in the
19
+ hypothetical release sequence X would head if it were a release
20
+ operation.
21
 
22
+ An atomic operation A that is a release operation on an atomic object M
23
+ synchronizes with an acquire fence B if there exists some atomic
24
+ operation X on M such that X is sequenced before B and reads the value
25
+ written by A or a value written by any side effect in the release
26
+ sequence headed by A.
27
 
28
  ``` cpp
29
  extern "C" void atomic_thread_fence(memory_order order) noexcept;
30
  ```
31
 
32
  *Effects:* Depending on the value of `order`, this operation:
33
 
34
+ - has no effects, if `order == memory_order::relaxed`;
35
+ - is an acquire fence, if `order == memory_order::acquire` or
36
+ `order == memory_order::consume`;
37
+ - is a release fence, if `order == memory_order::release`;
38
  - is both an acquire fence and a release fence, if
39
+ `order == memory_order::acq_rel`;
40
  - is a sequentially consistent acquire and release fence, if
41
+ `order == memory_order::seq_cst`.
42
 
43
  ``` cpp
44
  extern "C" void atomic_signal_fence(memory_order order) noexcept;
45
  ```
46
 
 
54
  inhibited in the same way as with `atomic_thread_fence`, but the
55
  hardware fence instructions that `atomic_thread_fence` would have
56
  inserted are not emitted. — *end note*]
57
 
58
  <!-- Link reference definitions -->
59
+ [atomic.types.int.comp]: #atomic.types.int.comp
60
+ [atomic.types.pointer.comp]: #atomic.types.pointer.comp
61
  [atomics]: #atomics
62
  [atomics.alias]: #atomics.alias
63
  [atomics.fences]: #atomics.fences
64
  [atomics.flag]: #atomics.flag
65
  [atomics.general]: #atomics.general
66
  [atomics.lockfree]: #atomics.lockfree
67
  [atomics.nonmembers]: #atomics.nonmembers
68
  [atomics.order]: #atomics.order
69
+ [atomics.ref.float]: #atomics.ref.float
70
+ [atomics.ref.generic]: #atomics.ref.generic
71
+ [atomics.ref.int]: #atomics.ref.int
72
+ [atomics.ref.memop]: #atomics.ref.memop
73
+ [atomics.ref.ops]: #atomics.ref.ops
74
+ [atomics.ref.pointer]: #atomics.ref.pointer
75
+ [atomics.summary]: #atomics.summary
76
  [atomics.syn]: #atomics.syn
77
+ [atomics.types.float]: #atomics.types.float
78
  [atomics.types.generic]: #atomics.types.generic
79
  [atomics.types.int]: #atomics.types.int
80
  [atomics.types.memop]: #atomics.types.memop
81
  [atomics.types.operations]: #atomics.types.operations
82
  [atomics.types.pointer]: #atomics.types.pointer
83
+ [atomics.wait]: #atomics.wait
84
+ [basic.align]: basic.md#basic.align
85
+ [basic.fundamental]: basic.md#basic.fundamental
86
+ [basic.life]: basic.md#basic.life
87
  [basic.types]: basic.md#basic.types
88
+ [cfenv]: numerics.md#cfenv
89
+ [compliance]: library.md#compliance
90
+ [expr.pre]: expr.md#expr.pre
91
+ [intro.multithread]: basic.md#intro.multithread
92
+ [intro.progress]: basic.md#intro.progress
93
+ [intro.races]: basic.md#intro.races
94
+ [limits.syn]: support.md#limits.syn
95
+ [smartptr]: utilities.md#smartptr
96
+ [util.smartptr.atomic]: #util.smartptr.atomic
97
+ [util.smartptr.atomic.shared]: #util.smartptr.atomic.shared
98
+ [util.smartptr.atomic.weak]: #util.smartptr.atomic.weak