名前空間
変種
操作

std::atomic

提供: cppreference.com
< cpp‎ | atomic


 
 
アトミック操作ライブラリ
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic(C++11)
atomic_is_lock_free(C++11)
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic_store
atomic_store_explicit
(C++11)
(C++11)
atomic_load
atomic_load_explicit
(C++11)
(C++11)
atomic_exchange
atomic_exchange_explicit
(C++11)
(C++11)
atomic_compare_exchange_weak
atomic_compare_exchange_weak_explicit
atomic_compare_exchange_strong
atomic_compare_exchange_strong_explicit
(C++11)
(C++11)
(C++11)
(C++11)
atomic_fetch_add
atomic_fetch_add_explicit
(C++11)
(C++11)
atomic_fetch_sub
atomic_fetch_sub_explicit
(C++11)
(C++11)
atomic_fetch_and
atomic_fetch_and_explicit
(C++11)
(C++11)
atomic_fetch_or
atomic_fetch_or_explicit
(C++11)
(C++11)
atomic_fetch_xor
atomic_fetch_xor_explicit
(C++11)
(C++11)
アトミックのフラグ
Original:
Atomic flags
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic_flag(C++11)
atomic_flag_test_and_set
atomic_flag_test_and_set_explicit
(C++11)
(C++11)
atomic_flag_clear
atomic_flag_clear_explicit
(C++11)
(C++11)
初期化
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic_init(C++11)
ATOMIC_VAR_INIT(C++11)
ATOMIC_FLAG_INIT(C++11)
メモリは発注
Original:
Memory ordering
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
memory_order(C++11)
kill_dependency(C++11)
atomic_thread_fence(C++11)
atomic_signal_fence(C++11)
 
std::atomic
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic::atomic
atomic::operator=
atomic::is_lock_free
atomic::store
atomic::load
atomic::operator T
atomic::exchange
atomic::compare_exchange
特殊なメンバ関数
Original:
Specialized member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic::fetch_add
atomic::fetch_sub
atomic::fetch_and
atomic::fetch_or
atomic::fetch_xor
atomic::operator++
atomic::operator++(int)
atomic::operator--
atomic::operator--(int)
atomic::operator+=
atomic::operator-=
atomic::operator&=
atomic::operator|=
atomic::operator^=
 
Defined in header <atomic>
template< class T >
struct atomic;
(1) (C + + 11以来)
template<>
struct atomic<Integral>;
(2) (C + + 11以来)
template< class T >
struct atomic<T*>;
(3) (C + + 11以来)
std::atomicテンプレートのそれぞれの完全な特殊化は、原子タイプを定義します。原子型のオブジェクトは、データ競合から解放されただけでC + +のオブジェクトであり、つまり、1つのスレッドが別のスレッドがそこから読み取っている間、動作が明確に定義されている原子オブジェクトに書き込みをしようとすると.
Original:
Each full specialization of the std::atomic template defines an atomic type. Objects of atomic types are the only C++ objects that are free from data races; that is, if one thread writes to an atomic object while another thread reads from it, the behavior is well-defined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
また、スレッド間同期と注文非アトミックメモリはようstd::memory_orderによって指定されたアクセスが確立するかもしれませんアトミックオブジェクトへのアクセスが.
Original:
In addition, accesses to atomic objects may establish inter-thread synchronization and order non-atomic memory accesses as specified by 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.
標準ライブラリには、次の種類のstd::atomicテンプレートの完全な特殊化を提供します
Original:
The standard library provides full specializations of the std::atomic template for the following types:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
タイプboolとそのtypedef名のため一点を特化は、それが標準的なレイアウト、些細なデフォルトコンストラクタ、些細なデストラクタを持っていることを除いて、非専門std::atomic<T>として扱われていることを定義し、集約の初期化構文をサポートします:
Original:
One specialization for the type bool and its typedef name is defined that is treated as a non-specialized std::atomic<T> except that it has standard layout, trivial default constructor, trivial destructors, and supports aggregate initialization syntax:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef名
Original:
Typedef name
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Full specialization
std::atomic_bool std::atomic<bool>
2)
整数型の専門化とtypedefは、としては、次のとおりです
Original:
Specializations and typedefs for integral types, as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef名
Original:
Typedef name
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Full specialization
std::atomic_char std::atomic<char>
std::atomic_schar std::atomic<signed char>
std::atomic_uchar std::atomic<unsigned char>
std::atomic_short std::atomic<short>
std::atomic_ushort std::atomic<unsigned short>
std::atomic_int std::atomic<int>
std::atomic_uint std::atomic<unsigned int>
std::atomic_long std::atomic<long>
std::atomic_ulong std::atomic<unsigned long>
std::atomic_llong std::atomic<long long>
std::atomic_ullong std::atomic<unsigned long long>
std::atomic_char16_t std::atomic<char16_t>
std::atomic_char32_t std::atomic<char32_t>
std::atomic_wchar_t std::atomic<wchar_t>
std::atomic_int_least8_t std::atomic<int_least8_t>
std::atomic_uint_least8_t std::atomic<uint_least8_t>
std::atomic_int_least16_t std::atomic<int_least16_t>
std::atomic_uint_least16_t std::atomic<uint_least16_t>
std::atomic_int_least32_t std::atomic<int_least32_t>
std::atomic_uint_least32_t std::atomic<uint_least32_t>
std::atomic_int_least64_t std::atomic<int_least64_t>
std::atomic_uint_least64_t std::atomic<uint_least64_t>
std::atomic_int_fast8_t std::atomic<int_fast8_t>
std::atomic_uint_fast8_t std::atomic<uint_fast8_t>
std::atomic_int_fast16_t std::atomic<int_fast16_t>
std::atomic_uint_fast16_t std::atomic<uint_fast16_t>
std::atomic_int_fast32_t std::atomic<int_fast32_t>
std::atomic_uint_fast32_t std::atomic<uint_fast32_t>
std::atomic_int_fast64_t std::atomic<int_fast64_t>
std::atomic_uint_fast64_t std::atomic<uint_fast64_t>
std::atomic_intptr_t std::atomic<intptr_t>
std::atomic_uintptr_t std::atomic<uintptr_t>
std::atomic_size_t std::atomic<size_t>
std::atomic_ptrdiff_t std::atomic<ptrdiff_t>
std::atomic_intmax_t std::atomic<intmax_t>
std::atomic_uintmax_t std::atomic<uintmax_t>
これらの専門分野は、標準的なレイアウト、些細なデフォルトコンストラクタ、些細なデストラクタを持っています。彼らは、集約の初期化構文をサポートしてい.
Original:
These specializations have standard layout, trivial default constructors, and trivial destructors. They support aggregate initialization syntax.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
すべてのポインタ型用std::atomic<T*>。これらの専門分野は、標準的なレイアウト、些細なデフォルトコンストラクタ、些細なデストラクタを持っています。彼らは、集計がサポートされています
Original:
std::atomic<T*> for all pointer types. These specializations have standard layout, trivial default constructors, and trivial destructors. They support aggregate
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
初期化の構文.
Original:
initialization syntax.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] メンバ関数

アトミックオブジェクトを作成します
Original:
constructs 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.

(パブリックメンバ関数) [edit]
アトミックオブジェクトに値を格納します
Original:
stores a value into 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.

(パブリックメンバ関数) [edit]
原子オブジェクトがロックフリーであるかどうかをチェックします
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.

(パブリックメンバ関数) [edit]
(C++11)
アトミックに非アトミック引数でアトミックオブジェクトの値を置き換えます
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.

(パブリックメンバ関数) [edit]
(C++11)
アトミックアトミックオブジェクトの値が取得されます
Original:
atomically obtains the value of the atomic object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
原子オブジェクトから値をロードします
Original:
loads a value from 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.

(パブリックメンバ関数) [edit]
(C++11)
アトミックアトミックオブジェクトの値を交換し、以前に保持している値を取得します
Original:
atomically replaced the value of the atomic object and obtains the value held previously
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
アトミックに非アトミック引数でアトミックオブジェクトの値を比較し、等しいか、またはアトミックロードする場合しない場合、原子交換を行う
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.

(パブリックメンバ関数) [edit]

[編集] 特殊なメンバ関数

(C++11)
アトミックアトミックオブジェクトに格納された値に引数を追加し、以前に保持している値を取得します
Original:
atomically adds the argument to the value stored in the atomic object and obtains the value held previously
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
(C++11)
アトミックアトミックオブジェクトに格納されている値から引数を減算し、以前に保持している値を取得します
Original:
atomically subtracts the argument from the value stored in the atomic object and obtains the value held previously
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
(C++11)
アトミックビット単位のAND引数とアトミックオブジェクトの値の間で実行され、以前に保持している値を取得します
Original:
atomically performs bitwise AND between the argument and the value of the atomic object and obtains the value held previously
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
(C++11)
atomically performs bitwise OR between the argument and the value of the atomic object and obtains the value held previously
(パブリックメンバ関数) [edit]
(C++11)
アトミック引数とアトミックオブジェクトの値の間でビット単位のXORを実行し、以前に保持している値を取得します
Original:
atomically performs bitwise XOR between the argument and the value of the atomic object and obtains the value held previously
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
増分または減分ずつの原子値
Original:
increments or decrements the atomic value by one
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
加算、減算、または原子値でビット単位のAND、OR、XORを実行します
Original:
adds, subtracts, or performs bitwise AND, OR, XOR with the atomic value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]

[編集] ノート

std::atomicのすべてのメンバー関数の非メンバ関数テンプレートの等価物があります。それらの非メンバ関数が追加std::atomicの特殊化ではありませんが、原子性を保証することができるタイプにオーバーロードすることができる。標準ライブラリにおける唯一のそのようなタイプがstd::shared_ptr<T>です.
Original:
There are non-member function template equivalents for all member functions of std::atomic. Those non-member functions may be additionally overloaded for types that are not specializations of std::atomic, but are able to guarantee atomicity. The only such type in the standard library is std::shared_ptr<T>.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] も参照してください

ロックフリーブール原子型
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.

(クラス) [edit]