Commit Graph

30 Commits

Author SHA1 Message Date
Andrey Semashev
e16092f473 Updated copyright year. 2018-03-18 01:39:40 +03:00
Andrey Semashev
8d5c592da2 Updated the Limitations section. 2018-02-27 02:20:09 +03:00
Andrey Semashev
b575159f8e Improved the wording of the note re. padding bits in FP types. 2018-02-13 04:09:24 +03:00
Andrey Semashev
edef50f042 Added support for atomic floating point operations.
The support includes:

- The standard fetch_add/fetch_sub operations.
- Extra operations: (fetch_/opaque_)negate, (opaque_)add/sub.
- Extra capability macros: BOOST_ATOMIC_FLOAT/DOUBLE/LONG_DOUBLE_LOCK_FREE.

The atomic operations are currently implemented on top of the integer-based
backends and thus are mostly CAS-based. The CAS operations perform binary
comparisons, and as such have different behavior wrt. special FP values like
NaN and signed zero than normal C++.

The support for floating point types is optional and can be disabled by
defining BOOST_ATOMIC_NO_FLOATING_POINT. This can be useful if on a certain
platform parameters of the floating point types cannot be deduced from the
compiler-defined or system macros (in which case the compilation fails).

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0020r6.html
2018-02-13 03:36:35 +03:00
Andrey Semashev
92c57ac1e4 Added atomic operations that return the result of the operation.
These operations are useful for two reasons. First, they are needed by
atomic<> interface as the pre-increment/decrement and add/subtract operators
need to perform the corresponding arithmetics and return the actual result while
not exhibiting UB in case of overflow. This means that the operation must be
performed on the unsigned storage type in the backend. Second, the (op)_and_test
operations on ARM and PowerPC can be implemented in a more generic way on top of
the operations that return the result. And since we have those operations
internally, why not expose them to users.

Added tests and docs for the new operations. Also, added docs for the recently
added scoped names of the memory_order enum values.

Also, added a specialized "emulated" backend for the extra operations. This
backend makes better use of the fact that the operations are lock-protected
by avoiding any CAS-based loops.
2018-02-11 00:56:23 +03:00
Andrey Semashev
9fd085c59f Added negate_and_test and complement_and_test ops.
As the names suggest, the methods perform the corresponding operation and test
if the result is not zero.

Also, for the emulated fetch_complement, take care of integral promotion, which
could mess up the storage bits that were not part of the value on backends
where the storage is larger than the value. This could in turn break CAS on
the atomic value as it compares the whole storage.
2018-02-04 00:13:27 +03:00
Andrey Semashev
b24cea0af1 Changed the result of (op)_and_test operations to the opposite.
This makes the result of (op)_and_test more consistent with other
methods such as test_and_set and bit_test_and_set, as well as the
methods used in the C++ standard library.

This is a breaking change. The users are able to define
BOOST_ATOMIC_HIGHLIGHT_OP_AND_TEST macro to generate warnings on each
use of the changed functions. This will help users to port from Boost
1.66 to newer Boost releases.

More info at:

https://github.com/boostorg/atomic/issues/11
http://boost.2283326.n4.nabble.com/atomic-op-and-test-naming-
tc4701445.html
2018-01-28 20:50:12 +03:00
Andrey Semashev
de22c6a203 Added a link to a gcc bug in the comment about consume/acquire MO. 2017-09-20 13:50:33 +03:00
Andrey Semashev
23d5770bde Minor docs formatting correction. 2017-08-06 22:09:41 +03:00
Andrey Semashev
b23afe4b0c Added docs for atomic_flag. 2017-08-06 22:04:26 +03:00
Andrey Semashev
4467cfbd3b Documented the extra operations added as an extension of Boost.Atomic.
Also made a few wording corrections and added is_always_lock_free and
a section about atomic<> typedefs. Clarified the status quo regarding
memory_order_consume. Removed the obsolete preudo-header for doxygen
that was not used for docs (if we want doxygen, it's better to
add comments to the real headers anyway).
2017-07-19 22:05:20 +03:00
Andrey Semashev
5b30e196a6 Added is_always_lock_free static constant from C++17. 2016-10-13 15:59:22 +03:00
Rene Rivera
019610574b Add, and update, documentation build targets. 2016-10-10 11:39:47 -05:00
Andrey Semashev
cc9cff37af Documented BOOST_ATOMIC_NO_CMPXCHG8B and BOOST_ATOMIC_NO_MFENCE config macros. 2016-09-15 01:19:52 +03:00
Andrey Semashev
ffe7710a90 Added a boostdoc target to unify Boost release docs building. 2016-01-06 21:04:08 +03:00
Andrey Semashev
4dee330229 Added support for types with non-trivial default constructors. 2014-07-07 22:40:41 +04:00
Andrey Semashev
560e3c0465 Clarified the requirements on the types compatible with boost::atomic. 2014-06-10 00:21:31 +04:00
Andrey Semashev
7fcb3b18b0 #9527. Fixed a typo in the docs. 2014-05-17 22:06:27 +04:00
Andrey Semashev
b80d0ebe36 Documented the BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT macro. 2014-05-17 20:07:52 +04:00
Andrey Semashev
00c21f9978 Documented new feature test and configuration macros. Fixed disabled gcc atomic backend. 2014-05-17 19:20:51 +04:00
Andrey Semashev
44e9f3c1b7 Added a readme and a logo. 2014-01-19 18:13:36 +04:00
Andrey Semashev
88eb902af7 More docs updates.
[SVN r84803]
2013-06-16 13:55:00 +00:00
Andrey Semashev
5f9abc8544 Added docs for atomicity detection macros.
[SVN r84802]
2013-06-16 13:46:39 +00:00
Tim Blechmann
a6b599b6bb atomic: fix example code
patch by gregor jasny

[SVN r82361]
2013-01-05 14:54:40 +00:00
Tim Blechmann
982dc948e3 atomic: fix typos
fixes #7804

[SVN r82072]
2012-12-18 09:43:23 +00:00
Andrey Semashev
39760bdd91 Updated reference to platform.hpp according to rearranged header layout.
[SVN r81933]
2012-12-14 11:32:31 +00:00
Tim Blechmann
8622f33f85 atomic: integrate documentation
[SVN r81757]
2012-12-07 14:52:41 +00:00
Tim Blechmann
be1524ea4e atomic: update documentation
[SVN r81737]
2012-12-06 12:35:42 +00:00
Helge Bahmann
71564c97cf Add missing copyright and licence notices
Add missing notices to various files to make clear they are distributable
under the boost licence.


[SVN r80527]
2012-09-14 19:12:13 +00:00
Helge Bahmann
131b70c1fa atomic: initial import
[SVN r79348]
2012-07-08 11:21:45 +00:00