std::atomic_is_lock_free, ATOMIC_xxx_LOCK_FREE
Aus cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| definiert in Header <atomic>
|
||
template< class Atomic > bool atomic_is_lock_free(const volatile Atomic* obj) |
(1) | (seit C++11) |
template< class Atomic > bool atomic_is_lock_free(const Atomic* obj) |
(2) | (seit C++11) |
#define ATOMIC_CHAR_LOCK_FREE /* unspecified */ #define ATOMIC_CHAR16_T_LOCK_FREE /* unspecified */ #define ATOMIC_CHAR32_T_LOCK_FREE /* unspecified */ #define ATOMIC_WCHAR_T_LOCK_FREE /* unspecified */ #define ATOMIC_SHORT_LOCK_FREE /* unspecified */ #define ATOMIC_INT_LOCK_FREE /* unspecified */ #define ATOMIC_LONG_LOCK_FREE /* unspecified */ #define ATOMIC_LLONG_LOCK_FREE /* unspecified */ #define ATOMIC_POINTER_LOCK_FREE /* unspecified */ |
(3) | (seit C++11) |
1-2)
Bestimmt, ob der atomare Objekt durch
obj wies umgesetzt Lock-freie, als ob durch den Aufruf obj->is_lock_free()Original:
Determines if the atomic object pointed to by
obj is implemented lock-free, as if by calling obj->is_lock_free()The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
3)
Erweitert, um eine Integer-Konstante Ausdruck mit dem Wert
0 für die eingebaute atomare Typen, die nie Lock-frei, um 1 für die eingebaute atomare Typen, die manchmal lock-frei, und 2 für die eingebaute atomare Typen, sind immer lock-free .Original:
Expands to an integer constant expression with value
0 for the built-in atomic types that are never lock-free, to 1 for the built-in atomic types that are sometimes lock-free, and to 2 for the built-in atomic types that are always lock-free.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Notes
Alle atomaren Typen außer std::atomic_flag kann unter Verwendung Mutexe oder andere Verriegelung Operationen, anstatt die Lock-freien Atom CPU-Instruktionen werden. Atomic Typen sind auch erlaubt sein manchmal Lock-frei, zum Beispiel wenn nur ausgerichtet Speicherzugriffe natürlicherweise atomaren auf einer gegebenen Architektur sind, haben fehlausgerichtet Gegenstände des gleichen Typs zu Sperren verwendet wird. Wenn der Typ ist manchmal lock-frei, dann die Funktion (1-2) oder ihr Mitglied Funktion äquivalent zu verwenden, um festzustellen, ob die jeweilige Instanz Lock-frei sein .
Original:
All atomic types except for std::atomic_flag may be implemented using mutexes or other locking operations, rather than using the lock-free atomic CPU instructions. Atomic types are also allowed to be sometimes lock-free, e.g. if only aligned memory accesses are naturally atomic on a given architecture, misaligned objects of the same type have to use locks. If the type is sometimes lock-free, then the function (1-2) or its member function equivalent has to be used to determine if the particular instance is lock-free.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parameter
| obj | - | Zeiger auf den atomaren Objekt zu untersuchen
Original: pointer to the atomic object to examine The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Rückgabewert
true wenn *obj ist ein Lock-freien Atom-, false sonst .Original:
true if *obj is a lock-free atomic, false otherwise.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Ausnahmen
Beispiel
| This section is incomplete Reason: no example |
Siehe auch
prüft, ob der atomare Objektsperre-frei ist Original: checks if the atomic object is lock-free The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion of std::atomic)
| |
spezialisiert atomare Operationen für std::shared_ptr Original: specializes atomic operations for std::shared_ptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Funktions-Template) | |
(C++11) |
Die Lock-freie boolean atomaren Typ Original: the lock-free boolean atomic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Klasse) |