Wednesday, August 31, 2016

C Library Header – stdatomic

<stdatomic.h> header is for atomic operations on data shared between threads.

The <stdatomic.h> header shall define the following macro constants:
ATOMIC_FLAG_INIT initializes a new atomic_flag (C11)
ATOMIC_VAR_INIT initializes a new atomic object (C11)
ATOMIC_BOOL_LOCK_FREE
ATOMIC_CHAR_LOCK_FREE
ATOMIC_CHAR16_T_LOCK_FREE
ATOMIC_CHAR32_T_LOCK_FREE
ATOMIC_WCHAR_T_LOCK_FREE
ATOMIC_SHORT_LOCK_FREE
ATOMIC_INT_LOCK_FREE
ATOMIC_LONG_LOCK_FREE
ATOMIC_LLONG_LOCK_FREE
ATOMIC_POINTER_LOCK_FREE
indicates that the given atomic type is lock-free (C11)
kill_dependency breaks a dependency chain for memory_order_consume (C11)

The <stdatomic.h> header shall define the following functions:
atomic_flag_test_and_set
atomic_flag_test_and_set_explicit
sets an atomic_flag to true and returns the old value (C11)
atomic_flag_clear
atomic_flag_clear_explicit
sets an atomic_flag to false (C11)
atomic_init initializes an existing atomic object (C11)
atomic_is_lock_free indicates whether the atomic object is lock-free (C11)
atomic_store
atomic_store_explicit
stores a value in an atomic object (C11)
atomic_load
atomic_load_explicit
reads a value from an atomic object (C11)
atomic_exchange
atomic_exchange_explicit
swaps a value with the value of an atomic object (C11)
atomic_compare_exchange_strong
atomic_compare_exchange_strong_explicit
atomic_compare_exchange_weak
atomic_compare_exchange_weak_explicit
swaps a value with the an atomic object if the old value is what is expected, otherwise reads the old value (C11)
atomic_fetch_add
atomic_fetch_add_explicit
atomic addition (C11)
atomic_fetch_sub
atomic_fetch_sub_explicit
atomic subtraction (C11)
atomic_fetch_or
atomic_fetch_or_explicit
atomic logical OR (C11)
atomic_fetch_xor
atomic_fetch_xor_explicit
atomic logical exclusive OR (C11)
atomic_fetch_and
atomic_fetch_and_explicit
atomic logical AND (C11)
atomic_thread_fence generic memory order-dependent fence synchronization primitive (C11)
atomic_signal_fence fence between a thread and a signal handler executed in the same thread (C11)

The <stdatomic.h> header shall define the following type:
memory_order defines memory ordering constraints (enum) (C11)
atomic_flag lock-free atomic boolean flag (struct)(C11)
atomic_bool
atomic_char
atomic_schar
atomic_uchar
atomic_short
atomic_ushort
atomic_int
atomic_uint
atomic_long
atomic_ulong
atomic_llong
atomic_ullong
atomic_char16_t
atomic_char32_t
atomic_wchar_t
atomic_int_least8_t
atomic_uint_least8_t
atomic_int_least16_t
atomic_uint_least16_t
atomic_int_least32_t
atomic_uint_least32_t
atomic_int_least64_t
atomic_uint_least64_t
atomic_int_fast8_t
atomic_uint_fast8_t
atomic_int_fast16_t
atomic_uint_fast16_t
atomic_int_fast32_t
atomic_uint_fast32_t
atomic_int_fast64_t
atomic_uint_fast64_t
atomic_intptr_t
atomic_uintptr_t
atomic_size_t
atomic_ptrdiff_t
atomic_intmax_t
atomic_uintmax_t
Data type’s(C11)



Related topics:
<setjmp.h>   |   <signal.h>   |   <stdalign.h>   |   <stdarg.h>   |   <stdbool.h>   |   Standard Library in C

List of topics: C Programming

No comments:

Post a Comment