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 |
-
|
| 26 |
-
|
| 27 |
-
[[basic.fundamental]], is always
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
-
[[
|
| 31 |
-
|
| 32 |
-
|
| 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 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
|