Atomic operations library
From cppreference.net
<
c
만약 매크로 상수
__STDC_NO_ATOMICS__
(C11)
가 컴파일러에 의해 정의되면, 헤더
<stdatomic.h>
, 키워드
_Atomic
, 그리고 여기에 나열된 모든 이름들이 제공되지 않습니다.
목차 |
타입
|
헤더 파일에 정의됨
<stdatomic.h>
|
|
|
(C11)
|
메모리 정렬 제약 조건을 정의함
(enum) |
|
(C11)
|
락-프리 원자적 불리언 플래그
(struct) |
매크로
|
헤더 파일에 정의됨
<stdatomic.h>
|
|
|
주어진 원자적 타입이 락-프리임을 나타냄
(매크로 상수) |
|
|
(C11)
|
새로운
atomic_flag
를 초기화함
(매크로 상수) |
|
(C11)
(C17에서 사용 중단됨)
(C23에서 제거됨)
|
새로운 원자적 객체를 초기화함
(함수 매크로) |
|
(C11)
|
memory_order_consume
를 위한 의존성 체인을 끊음
(함수 매크로) |
함수
|
헤더 파일에 정의됨
<stdatomic.h>
|
|
|
atomic_flag를 true로 설정하고 이전 값을 반환함
(함수) |
|
|
atomic_flag를 false로 설정함
(함수) |
|
|
(C11)
|
기존 atomic 객체를 초기화함
(함수) |
|
(C11)
|
atomic 객체가 lock-free인지 여부를 나타냄
(함수) |
|
atomic 객체에 값을 저장함
(함수) |
|
|
atomic 객체에서 값을 읽어옴
(함수) |
|
|
atomic 객체의 값과 값을 교환함
(함수) |
|
|
예상한 값과 이전 값이 일치하면 atomic 객체와 값을 교환하고, 그렇지 않으면 이전 값을 읽어옴
(함수) |
|
|
atomic 덧셈
(함수) |
|
|
atomic 뺄셈
(함수) |
|
|
atomic 비트 OR
(함수) |
|
|
atomic 비트 배타적 OR
(함수) |
|
|
atomic 비트 AND
(함수) |
|
|
(C11)
|
일반적인 메모리 순서 의존적 펜스 동기화 기본 요소
(함수) |
|
(C11)
|
같은 스레드에서 실행되는 시그널 핸들러와 스레드 사이의 펜스
(함수) |
타입
표준 라이브러리는 핵심 언어 원자 타입 에 대한 편의 typedef를 제공합니다.
| typedef 이름 | 전체 타입 이름 |
atomic_bool
|
_Atomic _Bool |
atomic_char
|
_Atomic char |
atomic_schar
|
_Atomic signed char |
atomic_uchar
|
_Atomic unsigned char |
atomic_short
|
_Atomic short |
atomic_ushort
|
_Atomic unsigned short |
atomic_int
|
_Atomic int |
atomic_uint
|
_Atomic unsigned int |
atomic_long
|
_Atomic long |
atomic_ulong
|
_Atomic unsigned long |
atomic_llong
|
_Atomic long long |
atomic_ullong
|
_Atomic unsigned long long |
atomic_char8_t
(C23)
|
_Atomic char8_t |
atomic_char16_t
|
_Atomic char16_t |
atomic_char32_t
|
_Atomic char32_t |
atomic_wchar_t
|
_Atomic wchar_t |
atomic_int_least8_t
|
_Atomic int_least8_t |
atomic_uint_least8_t
|
_Atomic uint_least8_t |
atomic_int_least16_t
|
_Atomic int_least16_t |
atomic_uint_least16_t
|
_Atomic uint_least16_t |
atomic_int_least32_t
|
_Atomic int_least32_t |
atomic_uint_least32_t
|
_Atomic uint_least32_t |
atomic_int_least64_t
|
_Atomic int_least64_t |
atomic_uint_least64_t
|
_Atomic uint_least64_t |
atomic_int_fast8_t
|
_Atomic int_fast8_t |
atomic_uint_fast8_t
|
_Atomic uint_fast8_t |
atomic_int_fast16_t
|
_Atomic int_fast16_t |
atomic_uint_fast16_t
|
_Atomic uint_fast16_t |
atomic_int_fast32_t
|
_Atomic int_fast32_t |
atomic_uint_fast32_t
|
_Atomic uint_fast32_t |
atomic_int_fast64_t
|
_Atomic int_fast64_t |
atomic_uint_fast64_t
|
_Atomic uint_fast64_t |
atomic_intptr_t
|
_Atomic intptr_t |
atomic_uintptr_t
|
_Atomic uintptr_t |
atomic_size_t
|
_Atomic size_t |
atomic_ptrdiff_t
|
_Atomic ptrdiff_t |
atomic_intmax_t
|
_Atomic intmax_t |
atomic_uintmax_t
|
_Atomic uintmax_t |
참고문헌
- C23 표준 (ISO/IEC 9899:2024):
-
- 7.17 Atomics <stdatomic.h> (p: TBD)
-
- 7.31.8 Atomics <stdatomic.h> (p: TBD)
- C17 표준 (ISO/IEC 9899:2018):
-
- 7.17 Atomics <stdatomic.h> (p: TBD)
-
- 7.31.8 Atomics <stdatomic.h> (p: TBD)
- C11 표준 (ISO/IEC 9899:2011):
-
- 7.17 Atomics <stdatomic.h> (p: 273-286)
-
- 7.31.8 Atomics <stdatomic.h> (p: 455-456)
참고 항목
|
C++ 문서
에 대한
Atomic operations library
|