Atomic operations. More...
#include <intrin.h>#include <windows.h>Macros | |
| #define | atomic_int8 volatile CHAR |
| Integer type for atomic operations. (int8) | |
| #define | atomic_int16 volatile SHORT |
| Integer type for atomic operations. (int16) | |
| #define | atomic_int32 volatile LONG |
| Integer type for atomic operations. (int32) | |
| #define | atomic_int64 volatile LONG64 |
| Integer type for atomic operations. (int64) | |
| #define | atomicExchange8(memory, value) |
| Atomically exchanges the value of the variable that memory points to. | |
| #define | atomicExchange16(memory, value) |
| Atomically exchanges the value of the variable that memory points to. | |
| #define | atomicExchange32(memory, value) |
| Atomically exchanges the value of the variable that memory points to. | |
| #define | atomicExchange64(memory, value) |
| Atomically exchanges the value of the variable that memory points to. | |
| #define | atomicFetchAnd8(memory, value) |
| Atomically performs AND operation to the variable that memory points to. | |
| #define | atomicFetchAnd16(memory, value) |
| Atomically performs AND operation to the variable that memory points to. | |
| #define | atomicFetchAnd32(memory, value) |
| Atomically performs AND operation to the variable that memory points to. | |
| #define | atomicFetchAnd64(memory, value) |
| Atomically performs AND operation to the variable that memory points to. | |
| #define | atomicFetchOr8(memory, value) |
| Atomically performs OR operation to the variable that memory points to. | |
| #define | atomicFetchOr16(memory, value) |
| Atomically performs OR operation to the variable that memory points to. | |
| #define | atomicFetchOr32(memory, value) |
| Atomically performs OR operation to the variable that memory points to. | |
| #define | atomicFetchOr64(memory, value) |
| Atomically performs OR operation to the variable that memory points to. | |
| #define | atomicFetchXor8(memory, value) |
| Atomically performs XOR operation to the variable that memory points to. | |
| #define | atomicFetchXor16(memory, value) |
| Atomically performs XOR operation to the variable that memory points to. | |
| #define | atomicFetchXor32(memory, value) |
| Atomically performs XOR operation to the variable that memory points to. | |
| #define | atomicFetchXor64(memory, value) |
| Atomically performs XOR operation to the variable that memory points to. | |
| #define | atomicFetchAdd8(memory, value) |
| Atomically adds the value to the variable that memory points to. | |
| #define | atomicFetchAdd16(memory, value) |
| Atomically adds the value to the variable that memory points to. | |
| #define | atomicFetchAdd32(memory, value) |
| Atomically adds the value to the variable that memory points to. | |
| #define | atomicFetchAdd64(memory, value) |
| Atomically adds the value to the variable that memory points to. | |
Atomic operations.
Atomic operations are used to perform certain operations in a way that is guaranteed to be indivisible and not subject to interruption by other threads. This is particularly useful in multithreaded programming to avoid race conditions and ensure correct behavior when multiple threads are concurrently accessing shared data.
| #define atomicExchange8 | ( | memory, | |
| value ) |
Atomically exchanges the value of the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be written |
| value | variable whose value is to be written to the variable that memory points to |
| #define atomicExchange16 | ( | memory, | |
| value ) |
Atomically exchanges the value of the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be written |
| value | variable whose value is to be written to the variable that memory points to |
| #define atomicExchange32 | ( | memory, | |
| value ) |
Atomically exchanges the value of the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be written |
| value | variable whose value is to be written to the variable that memory points to |
| #define atomicExchange64 | ( | memory, | |
| value ) |
Atomically exchanges the value of the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be written |
| value | variable whose value is to be written to the variable that memory points to |
| #define atomicFetchAnd8 | ( | memory, | |
| value ) |
Atomically performs AND operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the AND operation is to be performed |
| value | variable whose value is to be used for an AND operation |
| #define atomicFetchAnd16 | ( | memory, | |
| value ) |
Atomically performs AND operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the AND operation is to be performed |
| value | variable whose value is to be used for an AND operation |
| #define atomicFetchAnd32 | ( | memory, | |
| value ) |
Atomically performs AND operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the AND operation is to be performed |
| value | variable whose value is to be used for an AND operation |
| #define atomicFetchAnd64 | ( | memory, | |
| value ) |
Atomically performs AND operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the AND operation is to be performed |
| value | variable whose value is to be used for an AND operation |
| #define atomicFetchOr8 | ( | memory, | |
| value ) |
Atomically performs OR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the OR operation is to be performed |
| value | variable whose value is to be used for an OR operation |
| #define atomicFetchOr16 | ( | memory, | |
| value ) |
Atomically performs OR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the OR operation is to be performed |
| value | variable whose value is to be used for an OR operation |
| #define atomicFetchOr32 | ( | memory, | |
| value ) |
Atomically performs OR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the OR operation is to be performed |
| value | variable whose value is to be used for an OR operation |
| #define atomicFetchOr64 | ( | memory, | |
| value ) |
Atomically performs OR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the OR operation is to be performed |
| value | variable whose value is to be used for an OR operation |
| #define atomicFetchXor8 | ( | memory, | |
| value ) |
Atomically performs XOR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the XOR operation is to be performed |
| value | variable whose value is to be used for an XOR operation |
| #define atomicFetchXor16 | ( | memory, | |
| value ) |
Atomically performs XOR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the XOR operation is to be performed |
| value | variable whose value is to be used for an XOR operation |
| #define atomicFetchXor32 | ( | memory, | |
| value ) |
Atomically performs XOR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the XOR operation is to be performed |
| value | variable whose value is to be used for an XOR operation |
| #define atomicFetchXor64 | ( | memory, | |
| value ) |
Atomically performs XOR operation to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the XOR operation is to be performed |
| value | variable whose value is to be used for an XOR operation |
| #define atomicFetchAdd8 | ( | memory, | |
| value ) |
Atomically adds the value to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be added |
| value | variable whose value is to be added to the variable that memory points to |
| #define atomicFetchAdd16 | ( | memory, | |
| value ) |
Atomically adds the value to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be added |
| value | variable whose value is to be added to the variable that memory points to |
| #define atomicFetchAdd32 | ( | memory, | |
| value ) |
Atomically adds the value to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be added |
| value | variable whose value is to be added to the variable that memory points to |
| #define atomicFetchAdd64 | ( | memory, | |
| value ) |
Atomically adds the value to the variable that memory points to.
| [in,out] | memory | pointer of a variable to which the value is to be added |
| value | variable whose value is to be added to the variable that memory points to |