std::atomic_is_lock_free<std::shared_ptr>, std::atomic_load<std::shared_ptr>, std::atomic_store<std::shared_ptr>, std::atomic_...<std::shared_ptr>
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. |
<metanoindex/>
<tbody> </tbody> template< class T > bool atomic_is_lock_free( const std::shared_ptr<T>* p ); |
(1) | (dal C++11) |
template< class T > std::shared_ptr<T> atomic_load( const std::shared_ptr<T>* p ); |
(2) | (dal C++11) |
template< class T > std::shared_ptr<T> atomic_load_explicit( const shared_ptr<T>* p, std::memory_order mo ); |
(3) | (dal C++11) |
template< class T > void atomic_store( std::shared_ptr<T>* p, std::shared_ptr<T> r ); |
(4) | (dal C++11) |
template< class T > void atomic_store_explicit( std::shared_ptr<T>* p, shared_ptr<T> r, std::memory_order mo); |
(5) | (dal C++11) |
template< class T > std::shared_ptr<T> atomic_exchange( std::shared_ptr<T>* p, std::shared_ptr<T> r); |
(6) | (dal C++11) |
template<class T> std::shared_ptr<T> atomic_exchange_explicit( std::shared_ptr<T>* p, std::shared_ptr<T> r, std::memory_order mo); |
(7) | (dal C++11) |
template< class T > bool atomic_compare_exchange_weak( std::shared_ptr<T>* p, std::shared_ptr<T>* expected, std::shared_ptr<T> desired); |
(8) | (dal C++11) |
template<class T> bool atomic_compare_exchange_strong( std::shared_ptr<T>* p, std::shared_ptr<T>* expected, std::shared_ptr<T> desired); |
(9) | (dal C++11) |
template< class T > bool atomic_compare_exchange_strong_explicit( std::shared_ptr<T>* p, std::shared_ptr<T>* expected, std::shared_ptr<T> desired, std::memory_order success, std::memory_order failure); |
(10) | (dal C++11) |
template< class T > bool atomic_compare_exchange_weak_explicit( std::shared_ptr<T>* p, std::shared_ptr<T>* expected, std::shared_ptr<T> desired, std::memory_order success, std::memory_order failure); |
(11) | (dal C++11) |
Se più thread di esecuzione accedere all'oggetto riferimento il std::shared_ptr stesso senza sincronizzazione, una gara di dati può verificarsi, a meno che tutti tale accesso avviene attraverso queste funzioni, che sono specializzazioni parziali delle funzioni corrispondenti accesso atomiche (std::atomic_load, std::atomic_store, etc)
Original:
If multiple threads of execution access the object referenced by the same std::shared_ptr without synchronization, a data race may occur, unless all such access is performed through these functions, which are partial specializations of the corresponding atomic access functions (std::atomic_load, std::atomic_store, etc)
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.
{{{1}}}
Original:
{{{2}}}
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.
1)
Determina se l'accesso atomico al puntatore condiviso indicate da da
p è senza blocchi.Original:
Determines whether atomic access to the shared pointer pointed-to by
p 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.
2)
Equivalente a
atomic_load_explicit(p, std::memory_order_seq_cst)Original:
Equivalent to
atomic_load_explicit(p, std::memory_order_seq_cst)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)
Restituisce il puntatore condiviso indicato a da
p. Come per il non specializzato std::atomic_load_explicit, mo non può essere std::memory_order_release o std::memory_order_acq_relOriginal:
Returns the shared pointer pointed-to by
p. As with the non-specialized std::atomic_load_explicit, mo cannot be std::memory_order_release or std::memory_order_acq_relThe 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.
4)
Equivalente a
atomic_store_explicit(p, r, memory_order_seq_cst)Original:
Equivalent to
atomic_store_explicit(p, r, memory_order_seq_cst)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.
5)
Scambia i puntatori condivisi
p e r, in modo efficace l'esecuzione p->swap(r). Come per il non specializzato std::atomic_store_explicit, mo non può essere std::memory_order_acquire o std::memory_order_acq_relOriginal:
Swaps the shared pointers
p and r, effectively executing p->swap(r). As with the non-specialized std::atomic_store_explicit, mo cannot be std::memory_order_acquire or std::memory_order_acq_relThe 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.
6)
Equivalente a
atomic_exchange_explicit(p, r, memory_order_seq_cst)Original:
Equivalent to
atomic_exchange_explicit(p, r, memory_order_seq_cst)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.
7)
Scambia i puntatori condivisi
p e r, in modo efficace l'esecuzione p->swap(r) e restituisce una copia del puntatore condiviso in precedenza indicato da da pOriginal:
Swaps the shared pointers
p and r, effectively executing p->swap(r) and returns a copy of the shared pointer formerly pointed-to by pThe 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.
8)
Equivalente a
atomic_compare_exchange_weak_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)Original:
Equivalent to
atomic_compare_exchange_weak_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)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.
9)
Equivalente a
atomic_compare_exchange_strong_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)Original:
Equivalent to
atomic_compare_exchange_strong_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)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.
10)
Confronta i puntatori condivisi sottolineato-per da
p e expected. Se sono equivalenti (partecipazione azionaria del puntatore stesso e fare riferimento al puntatore stesso), assegna desired in *p utilizzando la memoria dei vincoli di ordine specificate da success e ritorna true. Se non sono equivalenti, assegna *p in *expected utilizzando la memoria dei vincoli di ordine specificate dal failure e ritorni false.Original:
Compares the shared pointers pointed-to by
p and expected. If they are equivalent (share ownership of the same pointer and refer to the same pointer), assigns desired into *p using the memory ordering constraints specified by success and returns true. If they are not equivalent, assigns *p into *expected using the memory ordering constraints specified by failure and returns false.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.
11)
Come 10), ma può cedere spurio.
Original:
Same as 10), but may fail spuriously.
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.
Tutte queste funzioni richiamare il comportamento non definito se
p è un puntatore nullo.Original:
All these functions invoke undefined behavior if
p is a null pointer.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.
Parametri
| p, expected | - | un puntatore a un std::shared_ptr
Original: a pointer to a 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. |
| r, desired | - | a std::shared_ptr |
| mo, success, failure | - | memoria ordinazione selettori di tipo std::memory_order
Original: memory ordering selectors of type std::memory_order The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Eccezioni
Queste funzioni non generano eccezioni.
Original:
These functions do not throw exceptions.
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.
Ritorno
1)
true atomica se l'accesso è implementato utilizzando blocco senza istruzioniOriginal:
true if atomic access is implemented using lock-free instructionsThe 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.
@ 2,3 @ Una copia del puntatore punta a condividere.
Original:
@2,3@ A copy of the pointed-to shared pointer.
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.
@ 4,5 @ nulla
Original:
@4,5@ nothing
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.
@ 6,7 @ Una copia del puntatore precedentemente indicato da condividere
Original:
@6,7@ A copy of the formerly pointed-to shared pointer
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.
@ @ 8,9,10,11
true se i puntatori condivisi erano equivalenti e lo scambio è stato eseguito, altrimenti false.Original:
@8,9,10,11@
true if the shared pointers were equivalent and the exchange was performed, 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.
Vedi anche
(C++11) |
controlla se le operazioni del tipo atomico sono senza blocchi Original: checks if the atomic type's operations are lock-free 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) (C++11) |
sostituisce atomicamente il valore dell'oggetto atomico con un non-atomica argomento Original: atomically replaces the value of the atomic object with a non-atomic argument 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) (C++11) |
atomicamente ottiene il valore memorizzato in un oggetto atomico Original: atomically obtains the value stored in an atomic object 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) (C++11) |
sostituisce atomicamente il valore dell'oggetto atomica con non-atomica argomento e restituisce il vecchio valore del atomica Original: atomically replaces the value of the atomic object with non-atomic argument and returns the old value of the atomic 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) |
confronta atomicamente il valore dell'oggetto atomica con non-atomica argomento ed esegue lo scambio atomico se il carico uguale o atomico in caso contrario Original: atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not 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) | |