configuration macro. The macto affects compilation on Darwin systems and
of waiting and notifying operations. This may be useful to comply with
Apple App Store requirements. (GH#55)
syscall, such as riscv32.
on clang 8 for 64-bit types on 32-bit x86 targets.
and the corresponding capability macros when targeting Windows 8 or later.
The library will now directly use
and related APIs from public headers and therefore require user to link
synchronization.lib if the user requires Windows 8 or
later by defining
_WIN32_WINNT or similar
macros. The library is linked automatically on compilers that support auto-linking
double on x86 targets. A new
macro is defined to indicate when clearing the padding is not supported.
ipc_atomic_ref no longer
use atomic instructions to clear the padding bits in the referenced object.
This reduces the cost of the atomic reference construction. This is considered
safe because clearing the padding does not issue writes to the bytes that
contribute to the object value. However, some thread safety checking software
may falsely detect this as a data race.
ipc_atomic are now
constexpr for enums, classes
and floating point types. For classes and floating point types, the constructors
constexpr if the compiler
std::bit_cast, the type has no padding bytes
and no padding is required to implement native atomic operations (i.e.,
atomic<T>, the object
T fits exactly in the internal
storage of the atomic).
ipc_atomic now perform
value initialization of the contained object. For types without a user-defined
default constructor, this means the default-constructed atomic will be
functions for constructing atomic reference objects.
ipc_atomic_ref to allow
omitting template arguments when they can be deduced from constructor arguments.
to some operations in
instruction on ARMv8-A. The instruction is used internally in spin loops
to reduce CPU power consumption.
a static boolean constant
and a set of capability macros that allow to detect if the implementation
supports native waiting and notifying operations for a given type.
to use 32-bit storage. This allows for more efficient waiting and notifying
on some platforms.
macro to specify binary logarithm of the size of the lock pool. The default
value is 8, meaning that the size of the lock pool is 256, up from 64 used
in the previous release.
ipc_atomic_ref. Users are recommended
to port their code using non-IPC types for inter-process communication
to the new types. The new types provide the same set of operations as their
non-IPC counterparts, with the following differences:
true for the
given atomic object. The library will issue a compile time error
if this precondition is known to be not satisfied at compile time.
- the referenced object) may be located in process-shared memory
or mapped into the same process at multiple different addresses.
constant indicate support for native inter-process waiting and notifying
operations. When that support is not present, the operations are
implemented with a busy loop, which is less efficient, but still
is address-free. A separate set of capability macros is also provided
to indicate this support.
types introduced in C++20. The types indicate the atomic object type for
an unsigned or signed integer, respectively, that is lock-free and preferably
has native support for waiting and notifying operations.
means that the operations no longer affect non-temporal stores, which was
also not guaranteed before. Use specialized instructions and intrinsics
to order non-temporal memory accesses.
double on x86 targets not indicating
lock-free operations even if 128-bit atomic operations were available.
intrinsics backend, fixed that store and load operations of large objects
(larger than a pointer size) could be non-atomic. The implementation currently
assumes that small objects can be stored with a single instruction atomically
on all modern architectures.
See docs and
especially the caveats
operation, which was introduced in C++20.
should now take into account alignment requirements of
which makes a difference if those requirements are higher than that of
the internal storage of
T used with
atomic_ref. This should
prohibit invalid types from being used as atomics.
bit_test_and_* operations on 8 and 16-bit arguments.
Other architectures are not affected.
compare_exchange_* operations, if alignment requirements
value_type are less
than that of the internal storage of
boost/atomic/atomic.hpp no longer includes
and only defines the
class template and related typedefs. Include the other headers explicitly
boost/atomic.hpp to include all parts of Boost.Atomic.
accessor and associated
type are deprecated. Instead, users are advised to use
respectively. Users can define
to disable deprecation warnings for the time of transition. The deprecated
pieces will be removed in a future release.
This macro was used as a helper for transition to the updated returned
operations in Boost.Atomic 1.67, which was released 2 years before 1.73.
not being considered as a floating point type by some versions of libstdc++.
operations added in Boost 1.66 to the opposite - the functions now return
true if the operation result
is non-zero. This is consistent with other
methods in Boost.Atomic and the C++ standard library. Users can define
when compiling their code to emit warnings on every use of the changed
functions. This way users can locate the code that needs to be updated.
memory_order enumeration is now scoped
and contains constants with shorter names like
seq_cst (i.e. users can use
memory_order::acquire instead of
The old constants are also provided for backward compatibility. (P0439R0)
operations and their
are supported. Lock-free property can be tested with the new macros
BOOST_ATOMIC_FLOAT/DOUBLE/LONG_DOUBLE_LOCK_FREE. The support for
floating point types is optional and can be disabled by defining
which perform negation or bitwise complement and return
true if the result is not zero.
operations which perform the operation and return its result.
specialization, the default constructor is now trivial if
T's default constructor is.
atomic<T> has been updated to avoid undefined
behavior that stems from signed integer overflows. As required by the C++
standard, the library uses two's complement representation of signed integers
internally and accroding rules of overflow. Currently, the library requires
the native signed integer types to also use two's complement representation
(but no defined overflow semantics).
fetch_complement - atomically replaces
the value with a negated or binary complemented value and returns
the original value
- equivalent to
fetch_<op> except that it doesn't return
the original value
- atomically applies
the result is zero. Note: The result
of these operations will change to the opposite in Boost 1.67. The
code that uses these functions will need to be updated.
- atomically sets, resets or complements the specified bit and returns
the original value of the bit
atomic<T>::difference_type member typedefs, where
applicable, to the user's code.
for conformance with C++17. The constant indicates that the given specialization
always provides lock-free implementation of atomic operations.
atomic<> storage. This should fix possible
issues on platforms that support atomic operations on data units larger
than the native word size. This may also change binary layout of user's
data structures that have
enumeration. The concrete values are not part of the interface, but this
change may potentially break ABI, if the enum is used in user's interfaces.
instruction in the target CPUs. Some early AMD CPUs don't support this
instruction. To target those define the
macro and static initialization of
atomic<> based on GCC
__atomic* intrinsics available since GCC 4.7.