Opened 9 years ago

Last modified 9 years ago

#9314 new Feature Requests

boost shared_ptr should use C++11 atomics when available

Reported by: anonymous Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

If a native assembly lock-free version is unavailable, boost should use native C++11 atomics if the library has them. This will far more reliably pick an efficient implementation for shared_ptr in cases where the optimized assembly version is unavailable and where sync support may be unavailable/not detected properly.

Change History (2)

comment:1 by viboes, 9 years ago

Component: Nonesmart_ptr
Owner: set to Peter Dimov

comment:2 by Peter Dimov, 9 years ago

https://github.com/boostorg/smart_ptr/commit/fed15ad8c50921cbfc0365156e4e4f4454dc1b91 adds support for #define BOOST_SP_USE_STD_ATOMIC which forces std::atomic to be used. This will eventually become the default when std::atomic is autodetected to be present and working.

Note: See TracTickets for help on using tickets.