From Jason Turner

[atomics.lockfree]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpmuofab0k/{from.md → to.md} +18 -17
tmp/tmpmuofab0k/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- ## Lock-free property <a id="atomics.lockfree">[[atomics.lockfree]]</a>
2
 
3
  ``` cpp
4
  #define ATOMIC_BOOL_LOCK_FREE unspecified
5
  #define ATOMIC_CHAR_LOCK_FREE unspecified
6
  #define ATOMIC_CHAR8_T_LOCK_FREE unspecified
@@ -20,27 +20,28 @@ grouped together. The properties also apply to the corresponding
20
  (partial) specializations of the `atomic` template. A value of 0
21
  indicates that the types are never lock-free. A value of 1 indicates
22
  that the types are sometimes lock-free. A value of 2 indicates that the
23
  types are always lock-free.
24
 
25
- At least one signed integral specialization of the `atomic` template,
26
- along with the specialization for the corresponding unsigned type
27
- [[basic.fundamental]], is always lock-free.
 
28
 
29
- [*Note 1*: This requirement is optional in freestanding implementations
30
- [[compliance]]. *end note*]
31
-
32
- The function `atomic_is_lock_free` [[atomics.types.operations]]
33
- indicates whether the object is lock-free. In any given program
34
- execution, the result of the lock-free query shall be consistent for all
35
- pointers of the same type.
36
 
37
  Atomic operations that are not lock-free are considered to potentially
38
  block [[intro.progress]].
39
 
40
- [*Note 2*: Operations that are lock-free should also be address-free.
41
- That is, atomic operations on the same memory location via two different
42
- addresses will communicate atomically. The implementation should not
43
- depend on any per-process state. This restriction enables communication
44
- by memory that is mapped into a process more than once and by memory
45
- that is shared between two processes. — *end note*]
 
 
 
46
 
 
1
+ ### Lock-free property <a id="atomics.lockfree">[[atomics.lockfree]]</a>
2
 
3
  ``` cpp
4
  #define ATOMIC_BOOL_LOCK_FREE unspecified
5
  #define ATOMIC_CHAR_LOCK_FREE unspecified
6
  #define ATOMIC_CHAR8_T_LOCK_FREE unspecified
 
20
  (partial) specializations of the `atomic` template. A value of 0
21
  indicates that the types are never lock-free. A value of 1 indicates
22
  that the types are sometimes lock-free. A value of 2 indicates that the
23
  types are always lock-free.
24
 
25
+ On a hosted implementation [[compliance]], at least one signed integral
26
+ specialization of the `atomic` template, along with the specialization
27
+ for the corresponding unsigned type [[basic.fundamental]], is always
28
+ lock-free.
29
 
30
+ The functions `atomic<T>::is_lock_free` and `atomic_is_lock_free`
31
+ [[atomics.types.operations]] indicate whether the object is lock-free.
32
+ In any given program execution, the result of the lock-free query is the
33
+ same for all atomic objects of the same type.
 
 
 
34
 
35
  Atomic operations that are not lock-free are considered to potentially
36
  block [[intro.progress]].
37
 
38
+ *Recommended practice:* Operations that are lock-free should also be
39
+ address-free.[^2]
40
+
41
+ The implementation of these operations should not depend on any
42
+ per-process state.
43
+
44
+ [*Note 1*: This restriction enables communication by memory that is
45
+ mapped into a process more than once and by memory that is shared
46
+ between two processes. — *end note*]
47