Namespaces
Variants

Standard library header <stdatomic.h> (C11)

From cppreference.net

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

目次

翻訳の説明: - 「Contents」を「目次」に翻訳しました - C++関連の専門用語(Atomic operations、Operations on atomic types、Flag type and operations、Initialization、Memory synchronization ordering、Convenience type aliases、Synopsis)は原文のまま保持しました - HTMLタグ、属性、クラス名、IDなどは一切変更していません - 番号付けや構造は完全に保持されています

アトミック操作

アトミック型に対する操作
指定されたアトミック型がロックフリーであることを示す
(マクロ定数)
アトミックオブジェクトがロックフリーかどうかを示す
(関数)
アトミックオブジェクトに値を格納する
(関数)
アトミックオブジェクトから値を読み取る
(関数)
アトミックオブジェクトの値と値を交換する
(関数)
期待値と一致する場合にアトミックオブジェクトの値を交換し、一致しない場合は古い値を読み取る
(関数)
アトミック加算
(関数)
アトミック減算
(関数)
アトミックビット単位OR
(関数)
アトミックビット単位排他的論理和
(関数)
アトミックビット単位AND
(関数)
フラグ型と操作
ロックフリーなアトミックブーリアンフラグ
(struct)
アトミックフラグをtrueに設定し、以前の値を返す
(関数)
アトミックフラグをfalseに設定する
(関数)
初期化
既存のアトミックオブジェクトを初期化する
(関数)
(C11) (C17で非推奨) (C23で削除)
新しいアトミックオブジェクトを初期化する
(関数マクロ)
新しい atomic_flag を初期化する
(マクロ定数)
メモリ同期順序
メモリ順序制約を定義する
(enum)
memory_order_consume の依存チェーンを解除します
(関数マクロ)
メモリ順序に依存する汎用フェンス同期プリミティブ
(関数)
同一スレッド内で実行されるスレッドとシグナルハンドラ間のフェンス
(関数)
**日本語訳:** **説明:** - HTMLタグ、属性、および` `、` `内のテキストは翻訳せず、元のまま保持しています - C++固有の用語(atomic_bool, _Atomic _Bool)は翻訳していません - フォーマットは完全に保持されています - 翻訳対象のテキストはありませんでした(「(C11)」はバージョン情報のため翻訳対象外) HTMLタグ、属性、 タグ内のテキスト、C++固有の用語は翻訳せず、元のフォーマットを保持しました。 **日本語訳:** **説明:** - `atomic_schar`、`_Atomic`、`signed char` はC++専門用語のため翻訳せず保持 - HTMLタグ、属性、` `タグ内のテキストは完全に保持 - `(C11)` はC言語仕様のバージョン表記のため保持 - 元の書式と構造を完全に維持 **翻訳結果:** **説明:** - HTMLタグ、属性、 タグ内のテキストは翻訳せず保持 - C++固有の用語(atomic_uchar, _Atomic, unsigned, char)は翻訳せず保持 - フォーマットと構造は完全に維持 - 翻訳対象のテキストがないため、出力は入力と同じ **翻訳結果:** **注記:** - HTMLタグ、属性、 タグ内のテキストは翻訳していません - C++固有の用語(atomic_ushort, _Atomic, unsigned, short)は翻訳していません - フォーマットは完全に保持されています **日本語訳:** **説明:** - `atomic_int` と `_Atomic int` はC++の専門用語のため翻訳せず保持 - HTMLタグ、属性、コードブロックは完全に保持 - C11はC言語のバージョンを示すため保持 - 書式と構造は完全に維持 **日本語訳:** **説明:** - HTMLタグ、属性、` `タグ内のテキストは翻訳せず保持 - C++固有の用語(`atomic_uint`, `_Atomic`, `unsigned`, `int`)は翻訳せず保持 - フォーマットと構造は完全に維持 **翻訳結果:** **説明:** - HTMLタグ、属性、` `タグ内のテキストは翻訳せず保持 - C++固有の用語(`atomic_long`, `_Atomic`, `long`)は翻訳せず保持 - 書式設定は完全に維持 - 翻訳対象のテキストがないため、元のHTML構造をそのまま出力 **日本語訳:** **説明:** - `atomic_ulong` と `_Atomic unsigned long` はC++の専門用語のため翻訳せず保持 - HTMLタグ、属性、コードブロックは完全に保持 - C11はバージョン表記のため翻訳せず保持 - 元のフォーマットと構造を完全に維持 **翻訳結果:** **説明:** - ` `タグ内の`atomic_ullong`はC++の型名のため翻訳対象外 - ` `内の`(C11)`はC言語規格バージョン表記のため翻訳対象外 - ` `内の`_Atomic`、`unsigned`、`long`、`long`はC言語のキーワードのため翻訳対象外 - HTMLタグ、属性、クラス名は全て保持 - フォーマットと構造は完全に維持 **翻訳結果:** **説明:** - HTMLタグ、属性はすべて保持 - ` `タグ内の`atomic_char16_t`はC++用語のため非翻訳 - ` `内の`_Atomic char16_t`はコードとして非翻訳 - その他のテキスト要素がないため、翻訳対象となるテキストはありません **日本語訳:** **説明:** - HTMLタグ、属性、コードブロックはそのまま保持されています - C++固有の用語(`atomic_wchar_t`, `_Atomic`, `wchar_t`)は翻訳されていません - 書式設定は完全に保持されています - C11の表記はそのまま維持されています **翻訳結果:** **説明:** - ` `タグ内の`atomic_int_least8_t`と` `内の`int_least8_t`はC++固有の用語のため翻訳せず - HTMLタグ、属性、構造は完全に保持 - `(C11)`はバージョン情報のため翻訳せず - `_Atomic`はC言語のキーワードのため翻訳せず - テキスト部分が全てC++関連の用語やコードであるため、翻訳対象となる自然言語テキストは存在しません **翻訳結果:** **注記:** - ` `タグ内の`atomic_uint_least8_t`はC++の型名のため翻訳対象外 - ` `内の`(C11)`はC言語規格のバージョン表記のため翻訳対象外 - ` `内の`_Atomic`と`uint_least8_t`はC言語のキーワードと型名のため翻訳対象外 - HTMLタグ、属性、クラス名はすべて保持 - フォーマットと構造は完全に維持 **翻訳結果:** **注記:** 指定された要件に従い、以下の通り翻訳を行いました: - HTMLタグと属性は翻訳せず、元のフォーマットを保持 - ` `、`
`、``タグ内のテキストは翻訳せず
- C++固有の用語(atomic_int_least16_t、_Atomic、int_least16_t)は翻訳せず
- このページには翻訳対象となる通常のテキストが含まれていません
**翻訳結果:** **説明:** - C++固有の用語 (`atomic_uint_least16_t`, `_Atomic`, `uint_least16_t`) は翻訳せず保持 - HTMLタグ、属性、` `タグ内のテキストは完全に保持 - 書式設定は元のまま維持 - プロフェッショナルで正確な翻訳を実施 **注記**: このHTML構造では、翻訳すべきテキスト部分がほとんど含まれていません。`(C11)`はC言語のバージョン指定であり、翻訳の対象外と判断しました。`atomic_int_least32_t`と`int_least32_t`はC++の型名、`_Atomic`はC言語のキーワードであるため、いずれも翻訳せずにそのまま保持しています。 **翻訳結果:** **注記:** - ` `タグ内の`atomic_uint_least32_t`はC++の型名であるため翻訳対象外 - ` `内の`(C11)`はバージョン指定であるため翻訳対象外 - ` `内の`_Atomic`と`uint_least32_t`はC++のキーワードと型名であるため翻訳対象外 - HTMLタグ、属性、構造は完全に保持されています **翻訳結果:** **説明:** - ` `タグ内の`atomic_int_least64_t`はC++の型名のため翻訳対象外 - ` `内の`(C11)`はC言語規格のバージョン表記のため翻訳対象外 - ` `内の`_Atomic`と`int_least64_t`はC言語のキーワードと型名のため翻訳対象外 - HTMLタグ、属性、クラス名はすべて保持 - フォーマットと構造は完全に維持 **注記**: この翻訳では以下のルールに従っています: - HTMLタグと属性は翻訳せず、元のフォーマットを保持 - ` `タグ内のテキストは翻訳対象外 - C++固有の用語(atomic_uint_least64_t, _Atomic, uint_least64_t)は翻訳せず - プロフェッショナルで正確な翻訳を提供 **翻訳結果:** **説明:** - HTMLタグ、属性、および` `タグ内のC++固有の用語(`atomic_int_fast8_t`、`_Atomic`、`int_fast8_t`)は翻訳せず、元のまま保持しています - 書式設定と構造は完全に維持されています - C11というバージョン情報もそのまま保持しています **翻訳結果:** **注記:** - HTMLタグ、属性、 タグ内のテキストは翻訳対象外として保持 - C++固有の用語(atomic_uint_fast8_t, _Atomic, uint_fast8_t)は翻訳せず保持 - フォーマットと構造は完全に維持 **翻訳結果:** **説明:** - HTMLタグ、属性、 タグ内のテキストは翻訳せずに保持 - C++固有の用語(atomic_int_fast16_t, _Atomic, int_fast16_t)は翻訳せず - フォーマットと構造は完全に保持 - 翻訳対象のテキストがないため、元のHTMLがそのまま出力されています **翻訳結果:** **説明:** - ` `タグ内の`atomic_uint_fast16_t`はC++の型名のため翻訳対象外 - ` `内の`uint_fast16_t`はC++の型名のため翻訳対象外 - `_Atomic`はC言語のキーワードのため翻訳対象外 - HTMLタグ、属性、クラス名はすべて保持 - `(C11)`はバージョン情報のため翻訳対象外 **翻訳結果:** **説明:** - HTMLタグ、属性はすべて保持 - ` `タグ内の`atomic_int_fast32_t`はC++用語のため非翻訳 - ` `内の`int_fast32_t`はC++用語のため非翻訳 - ` `内の`(C11)`はバージョン表記のため非翻訳 - `_Atomic`はC言語のキーワードのため非翻訳 - その他のテキスト要素がないため、翻訳対象となるテキストはありません **翻訳結果:** **説明:** - HTMLタグ、属性はすべて保持 - ` `、`
`、``タグ内のテキストは翻訳対象外
- C++固有の用語(`atomic_uint_fast32_t`、`_Atomic`、`uint_fast32_t`)は翻訳せず保持
- フォーマットは完全に維持
**翻訳結果:** **説明:** - HTMLタグ、属性、 タグ内のテキストは翻訳せず保持 - C++固有の用語(atomic_int_fast64_t, _Atomic, int_fast64_t)は翻訳せず保持 - 元のフォーマットと構造を完全に維持 **翻訳結果:** **説明:** - ` `タグ内の`atomic_uint_fast64_t`はC++の型名のため翻訳対象外 - ` `内の`(C11)`はC言語規格のバージョン表記のため翻訳対象外 - ` `内の`_Atomic`と`uint_fast64_t`はC言語のキーワードと型名のため翻訳対象外 - HTMLタグ、属性、クラス名はすべて保持 - フォーマットと構造は完全に維持 **日本語訳:** **説明:** - `atomic_intptr_t` と `intptr_t` はC++の専門用語のため、翻訳せずにそのまま保持しました - `_Atomic` はC言語のキーワードのため、翻訳せずに保持しました - HTMLタグ、属性、および` `タグ内のテキストはすべて保持されています - 構造とフォーマットは完全に維持されています **日本語訳:** **説明:** - HTMLタグ、属性、および` `タグ内のテキストは翻訳していません - C++固有の用語(`atomic_uintptr_t`、`_Atomic`、`uintptr_t`)は翻訳していません - フォーマットは完全に保持されています - `(C11)`はC言語仕様のバージョンを示すため、そのまま保持しています **翻訳結果:** **説明:** - ` `タグ内の`atomic_ptrdiff_t`はC++の型名なので翻訳せず保持 - ` `内の`(C11)`はC言語のバージョン指定なので翻訳せず保持 - ` `内の`_Atomic`と`ptrdiff_t`はC++のキーワードと型名なので翻訳せず保持 - HTMLタグ、属性、構造は完全に保持 - 翻訳対象のテキストが存在しないため、元のHTMLをそのまま出力 **日本語訳:** **説明:** - `atomic_uintmax_t` と `uintmax_t` はC++固有の用語のため翻訳せず保持 - `_Atomic` はC言語のキーワードのため翻訳せず保持 - HTMLタグ、属性、コードブロックは完全に保持 - C11はC言語規格のバージョンを示すため保持
利便性のための型エイリアス
型定義名 完全な型名
atomic_bool (C11) _Atomic _Bool
atomic_bool (C11) _Atomic _Bool
atomic_char (C11) _Atomic char
atomic_schar (C11) _Atomic signed char
atomic_schar (C11) _Atomic signed char
atomic_uchar (C11) _Atomic unsigned char
atomic_uchar (C11) _Atomic unsigned char
atomic_short (C11) _Atomic short
atomic_ushort (C11) _Atomic unsigned short
atomic_ushort (C11) _Atomic unsigned short
atomic_int (C11) _Atomic int
atomic_int (C11) _Atomic int
atomic_uint (C11) _Atomic unsigned int
atomic_uint (C11) _Atomic unsigned int
atomic_long (C11) _Atomic long
atomic_long (C11) _Atomic long
atomic_ulong (C11) _Atomic unsigned long
atomic_ulong (C11) _Atomic unsigned long
atomic_llong (C11) _Atomic long long
atomic_ullong (C11) _Atomic unsigned long long
atomic_ullong (C11) _Atomic unsigned long long
atomic_char8_t (C23) _Atomic char8_t
atomic_char16_t (C11) _Atomic char16_t
atomic_char16_t (C11) _Atomic char16_t
atomic_char32_t (C11) _Atomic char32_t
atomic_wchar_t (C11) _Atomic wchar_t
atomic_wchar_t (C11) _Atomic wchar_t
atomic_int_least8_t (C11) _Atomic int_least8_t
atomic_int_least8_t (C11) _Atomic int_least8_t
atomic_uint_least8_t (C11) _Atomic uint_least8_t
atomic_uint_least8_t (C11) _Atomic uint_least8_t
atomic_int_least16_t (C11) _Atomic int_least16_t
atomic_int_least16_t (C11) _Atomic int_least16_t
atomic_uint_least16_t (C11) _Atomic uint_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_uint_least32_t (C11) _Atomic uint_least32_t
atomic_int_least64_t (C11) _Atomic int_least64_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_int_fast8_t (C11) _Atomic int_fast8_t
atomic_uint_fast8_t (C11) _Atomic uint_fast8_t
atomic_uint_fast8_t (C11) _Atomic uint_fast8_t
atomic_int_fast16_t (C11) _Atomic int_fast16_t
atomic_int_fast16_t (C11) _Atomic int_fast16_t
atomic_uint_fast16_t (C11) _Atomic uint_fast16_t
atomic_uint_fast16_t (C11) _Atomic uint_fast16_t
atomic_int_fast32_t (C11) _Atomic int_fast32_t
atomic_int_fast32_t (C11) _Atomic int_fast32_t
atomic_uint_fast32_t (C11) _Atomic uint_fast32_t
atomic_uint_fast32_t (C11) _Atomic uint_fast32_t
atomic_int_fast64_t (C11) _Atomic int_fast64_t
atomic_int_fast64_t (C11) _Atomic int_fast64_t
atomic_uint_fast64_t (C11) _Atomic uint_fast64_t
atomic_uint_fast64_t (C11) _Atomic uint_fast64_t
atomic_intptr_t (C11) _Atomic intptr_t
atomic_intptr_t (C11) _Atomic intptr_t
atomic_uintptr_t (C11) _Atomic uintptr_t
atomic_uintptr_t (C11) _Atomic uintptr_t
atomic_size_t (C11) _Atomic size_t
atomic_ptrdiff_t (C11) _Atomic ptrdiff_t
atomic_ptrdiff_t (C11) _Atomic ptrdiff_t
atomic_intmax_t (C11) _Atomic intmax_t
atomic_uintmax_t (C11) _Atomic uintmax_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);