std::atomic_is_lock_free, ATOMIC_xxx_LOCK_FREE
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <atomic> | ||
template<class Atomic > bool atomic_is_lock_free(constvolatile Atomic* obj) | (1) | (dal C++11) |
template<class Atomic > bool atomic_is_lock_free(const Atomic* obj) | (2) | (dal C++11) |
#define ATOMIC_CHAR_LOCK_FREE /* unspecified */ #define ATOMIC_CHAR16_T_LOCK_FREE /* unspecified */ | (3) | (dal C++11) |
Determina se l'oggetto atomico puntato da
3) obj
è attuato senza blocchi, come per chiamare 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.
Si espande un'espressione intera costante con 0 valore per il built-in tipi atomici che non sono mai senza blocchi, per 1 per il built-in tipi atomici che sono a volte senza blocchi, e per 2 per il built-in tipi atomici che sono sempre senza blocchi.
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.
Indice |
[modifica]Note
Tutti i tipi atomici tranne std::atomic_flag può essere implementato usando mutex o di operazioni di chiusura di altri, piuttosto che utilizzare il blocco senza istruzioni della CPU atomiche. Tipi atomici sono anche permesso di essere a volte senza blocchi, ad esempio, se gli accessi alla memoria solo allineati sono naturalmente atomica su una data architettura, oggetti allineati dello stesso tipo devono usare serrature. Se il tipo è talvolta senza blocchi, allora la funzione (1-2) o il suo equivalente funzione membro deve essere utilizzato per determinare se il caso particolare è senza blocchi.
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.
[modifica]Parametri
obj | - | puntatore all'oggetto atomico di esaminare 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. |
[modifica]Valore di ritorno
true se *obj è un lock-free atomico, false altrimenti.
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.
[modifica]Eccezioni
[modifica]Esempio
This section is incomplete Reason: no example |
[modifica]Vedi anche
controlla se l'oggetto atomico è senza blocchi 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. (metodo pubblico) | |
specializzata operazioni atomiche per 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. (funzione di modello) | |
(C++11) | il blocco privo di tipo booleano atomica 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. (classe) |