名前空間
変種
操作

標準ライブラリヘッダ <stdatomic.h> (C11)

From cppreference.com

このヘッダはアトミック操作を提供します。特に、並行性サポートライブラリの一部です。

目次

[編集] アトミック操作

アトミック型に対する操作
指定されたアトミック型がロックフリーであることを示す
(マクロ定数) [編集]
アトミックオブジェクトがロックフリーであるかを示す
(関数) [編集]
アトミックオブジェクトに値を格納する
(関数) [編集]
アトミックオブジェクトから値を読み込む
(関数) [編集]
アトミックオブジェクトの値と値を交換する
(関数) [編集]
古い値が期待値と同じであればアトミックオブジェクトと値を交換し、そうでなければ古い値を読み込む
(関数) [編集]
アトミック加算
(関数) [編集]
アトミック減算
(関数) [編集]
アトミックビットOR
(関数) [編集]
アトミックビット排他的OR
(関数) [編集]
アトミックビットAND
(関数) [編集]
フラグ型と操作
ロックフリーアトミックブーリアンフラグ
(構造体)[編集]
atomic_flagをtrueに設定し、古い値を返す
(関数) [編集]
atomic_flagをfalseに設定する
(関数) [編集]
初期化
既存のアトミックオブジェクトを初期化する
(関数) [編集]
(C11)(C17で非推奨)(C23で削除)
新しいアトミックオブジェクトを初期化する
(関数マクロ) [編集]
新しいatomic_flagを初期化する
(マクロ定数) [編集]
メモリ同期順序
メモリ順序制約を定義する
(enum) [編集]
memory_order_consumeの依存関係チェーンを中断する
(関数マクロ) [編集]
汎用的なメモリ順序依存のフェンス同期プリミティブ
(関数) [編集]
スレッドと、同じスレッドで実行されるシグナルハンドラとの間のフェンス
(関数) [編集]
便利な型エイリアス
Typedef名 完全型名
atomic_bool (C11) _Atomic _Bool
atomic_char (C11) _Atomic char
atomic_schar (C11) _Atomic signed char
atomic_uchar (C11) _Atomic unsigned char
atomic_short (C11) _Atomic short
atomic_ushort (C11) _Atomic unsigned short
atomic_int (C11) _Atomic int
atomic_uint (C11) _Atomic unsigned int
atomic_long (C11) _Atomic long
atomic_ulong (C11) _Atomic unsigned long
atomic_llong (C11) _Atomic long long
atomic_ullong (C11) _Atomic unsigned long long
atomic_char8_t (C23) _Atomic char8_t
atomic_char16_t (C11) _Atomic char16_t
atomic_char32_t (C11) _Atomic char32_t
atomic_wchar_t (C11) _Atomic wchar_t
atomic_int_least8_t (C11) _Atomic int_least8_t
atomic_uint_least8_t (C11) _Atomic uint_least8_t
atomic_int_least16_t (C11) _Atomic int_least16_t
atomic_uint_least16_t (C11) _Atomic uint_least16_t
atomic_int_least32_t (C11) _Atomic int_least32_t
atomic_uint_least32_t (C11) _Atomic uint_least32_t
atomic_int_least64_t (C11) _Atomic int_least64_t
atomic_uint_least64_t (C11) _Atomic uint_least64_t
atomic_int_fast8_t (C11) _Atomic int_fast8_t
atomic_uint_fast8_t (C11) _Atomic uint_fast8_t
atomic_int_fast16_t (C11) _Atomic int_fast16_t
atomic_uint_fast16_t (C11) _Atomic uint_fast16_t
atomic_int_fast32_t (C11) _Atomic int_fast32_t
atomic_uint_fast32_t (C11) _Atomic uint_fast32_t
atomic_int_fast64_t (C11) _Atomic int_fast64_t
atomic_uint_fast64_t (C11) _Atomic uint_fast64_t
atomic_intptr_t (C11) _Atomic intptr_t
atomic_uintptr_t (C11) _Atomic uintptr_t
atomic_size_t (C11) _Atomic size_t
atomic_ptrdiff_t (C11) _Atomic ptrdiff_t
atomic_intmax_t (C11) _Atomic intmax_t
atomic_uintmax_t (C11) _Atomic uintmax_t

[編集] 概要

#define __STDC_VERSION_STDATOMIC_H__ 202311L
 
void atomic_init(volatile A* obj, /*C*/ value);
/*type*/ kill_dependency(/*type*/ y);
void atomic_thread_fence(memory_order order);
void atomic_signal_fence(memory_order order);
bool atomic_is_lock_free(const volatile A* obj);
void atomic_store(volatile A* object, /*C*/ desired);
void atomic_store_explicit(volatile A* object, /*C*/ desired, memory_order order);
/*C*/ atomic_load(const volatile A* object);
/*C*/ atomic_load_explicit(const volatile A* object, memory_order order);
/*C*/ atomic_exchange(volatile A* object, /*C*/ desired);
/*C*/ atomic_exchange_explicit(volatile A* object, /*C*/ desired, memory_order order);
bool atomic_compare_exchange_strong(volatile A* object, /*C*/* expected, /*C*/ desired);
bool atomic_compare_exchange_strong_explicit(volatile A* object, /*C*/* expected,
/*C*/ desired, memory_order success, memory_order failure);
bool atomic_compare_exchange_weak(volatile A* object, /*C*/* expected, /*C*/ desired);
bool atomic_compare_exchange_weak_explicit(volatile A* object, /*C*/* expected,
/*C*/ desired, memory_order success, memory_order failure);
/*C*/ /*atomic_fetch_key*/(volatile A* object, M operand);
/*C*/ /*atomic_fetch_key_explicit*/(volatile A* object, M operand, memory_order order);
bool atomic_flag_test_and_set(volatile atomic_flag* object);
bool atomic_flag_test_and_set_explicit(volatile atomic_flag* object,
memory_order order);
void atomic_flag_clear(volatile atomic_flag* object);
void atomic_flag_clear_explicit(volatile atomic_flag* object,
                                memory_order order);
English 日本語 中文(简体) 中文(繁體)