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>
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> template< class T > bool atomic_is_lock_free( const std::shared_ptr<T>* p ); |
(1) | (seit C++11) |
template< class T > std::shared_ptr<T> atomic_load( const std::shared_ptr<T>* p ); |
(2) | (seit C++11) |
template< class T > std::shared_ptr<T> atomic_load_explicit( const shared_ptr<T>* p, std::memory_order mo ); |
(3) | (seit C++11) |
template< class T > void atomic_store( std::shared_ptr<T>* p, std::shared_ptr<T> r ); |
(4) | (seit C++11) |
template< class T > void atomic_store_explicit( std::shared_ptr<T>* p, shared_ptr<T> r, std::memory_order mo); |
(5) | (seit C++11) |
template< class T > std::shared_ptr<T> atomic_exchange( std::shared_ptr<T>* p, std::shared_ptr<T> r); |
(6) | (seit 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) | (seit 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) | (seit 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) | (seit 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) | (seit 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) | (seit C++11) |
Wenn mehrere Ausführungs-Threads Zugriff auf das Objekt von der gleichen std::shared_ptr ohne Synchronisation verwiesen wird, kann ein Daten-Rennen auftreten, wenn alle diesen Zugang durch diese Funktionen, die eine partielle Spezialisierungen der entsprechenden atomaren Zugriff Funktionen (std::atomic_load, std::atomic_store, etc) sind durchgeführt wird
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)
Bestimmt, ob atomaren Zugriff auf den freigegebenen Zeiger von
p zu spitz ist lock-free .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)
Entspricht
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)
Gibt die geteilten Zeiger gezeigt-bis
p. Wie bei dem nicht spezialisierten std::atomic_load_explicit kann mo nicht std::memory_order_release sein oder 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)
Entspricht
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)
Tauscht die gemeinsame Zeiger
p und r, effektiv ausführt p->swap(r). Wie bei dem nicht spezialisierten std::atomic_store_explicit kann mo nicht std::memory_order_acquire sein oder 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)
Entspricht
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)
Tauscht die gemeinsame Zeiger
p und r, effektiv ausführt p->swap(r) und gibt eine Kopie des freigegebenen Zeiger früher spitz-durch 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)
Entspricht
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)
Entspricht
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)
Vergleicht die freigegebenen Zeiger wies-bis
p und expected. Wenn sie gleichwertig sind (Anteilsbesitz des gleichen Zeiger und beziehen sich auf die gleichen Zeiger), ordnet desired in *p mit der Speicher-Bestellung Zwänge success und kehrt true angegeben. Wenn sie nicht gleich sind, weist *p in *expected mit der Speicher-Bestellung Zwänge failure angegeben und kehrt 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)
Gleiche wie 10), kann aber fälschlicherweise nicht .
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.
All diese Funktionen aufzurufen undefinierten Verhalten, wenn
p ist ein Null-Zeiger .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.
Parameter
| p, expected | - | einen Zeiger auf eine 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 | - | Speicher Bestellung Selektoren des Typs 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. |
Ausnahmen
Diese Funktionen sind keine Ausnahmen .
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.
Zurückzukehren
1)
true wenn atomaren Zugriff erfolgt über Lock-freie AnweisungenOriginal:
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 @ Eine Kopie des spitzen-to gemeinsamen Zeiger .
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 @ nichts
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 @ Eine Kopie der ehemals spitz-auf freigegebene Zeiger
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 wenn die freigegebenen Zeiger gleichwertig waren und der Austausch durchgeführt wurde, false sonst .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.
Siehe auch
(C++11) |
Prüft, ob die Operationen eines atomaren Typs lock-frei sind (Funktions-Template) |
(C++11) (C++11) |
ersetzt atomar den Wert des atomaren Objekts durch ein nichtatomares Argument 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. (Funktions-Template) |
(C++11) (C++11) |
erhält atomar den Wert eines atomaren Objekts 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. (Funktions-Template) |
(C++11) (C++11) |
atomar ersetzt den Wert des atomaren Objekt mit nicht-elementare Argument und gibt den alten Wert des atomaren 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. (Funktions-Template) |
atomar vergleicht den Wert des atomaren Objekt mit nicht-elementare Argument und führt atomaren Austausch wenn gleiche oder atomare Last, wenn nicht 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. (Funktions-Template) | |