From 6f786378658ecf367f3018a7a638d69957d6cdb9 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 14 Aug 2017 13:31:59 +0300 Subject: [PATCH] issue #82: added doc about DCAS support --- cds/details/defs.h | 8 ++++++++ cds/gc/dhp.h | 9 +++++++++ readme.md | 10 ++++++++++ 3 files changed, 27 insertions(+) diff --git a/cds/details/defs.h b/cds/details/defs.h index 594c8229..6c737efa 100644 --- a/cds/details/defs.h +++ b/cds/details/defs.h @@ -169,6 +169,14 @@ - \p boost.thread (thread-loal storage support), boost.system - \p google-test + Some parts of libcds may depend on DCAS (double-width compare-and-swap) atomic primitive if + the target architecture supports it. For x86, cmake build script enables -mcx16 compiler flag that + switches DCAS support on. You may manually disable DCAS support with the following command line flags + in GCC/clang (for MS VC++ compiler DCAS is not supported): + - \p -DCDS_DISABLE_128BIT_ATOMIC - for 64bit build + - \p -DCDS_DISABLE_64BIT_ATOMIC - for 32bit build + @warning All your projects AND libcds MUST be compiled with the same flags - either with DCAS support or without it. + \par Windows build Prerequisites: for building cds library and test suite you need: diff --git a/cds/gc/dhp.h b/cds/gc/dhp.h index 01ff54c6..3752a083 100644 --- a/cds/gc/dhp.h +++ b/cds/gc/dhp.h @@ -685,6 +685,15 @@ namespace cds { namespace gc { %DHP is an adaptive variant of classic \p cds::gc::HP, see @ref cds_garbage_collectors_comparison "Compare HP implementation" + @note: Internally, %DHP depends on free-list implementation. There are + DCAS-based free-list \p cds::intrusive::TaggedFreeList and more complicated CAS-based free-list + \p cds::intrusive::FreeList. For x86 architecture and GCC/clang, libcds selects appropriate free-list + based on \p -mcx16 compiler flag. You may manually disable DCAS support specifying + \p -DCDS_DISABLE_128BIT_ATOMIC for 64bit build or \p -DCDS_DISABLE_64BIT_ATOMIC for 32bit build + in compiler command line. All your projects and libcds MUST be compiled with the same flags - + either with DCAS support or without it. + For MS VC++ compiler DCAS is not supported. + See \ref cds_how_to_use "How to use" section for details how to apply SMR. */ class DHP diff --git a/readme.md b/readme.md index 54c6f15b..539796d5 100644 --- a/readme.md +++ b/readme.md @@ -46,6 +46,16 @@ Evolution of libcds (Gource visualization by Landon Wilkins): https://www.youtub - *nix: [use CMake](build/cmake/readme.md) - Windows: use MS Visual C++ 2015 project +Some parts of libcds may depend on DCAS (double-width compare-and-swap) atomic primitive if +the target architecture supports it. For x86, cmake build script enables `-mcx16` compiler flag that +switches DCAS support on. You may manually disable DCAS support with the following command line flags +in GCC/clang (for MS VC++ compiler DCAS is not supported): + - `-DCDS_DISABLE_128BIT_ATOMIC` - for 64bit build + - `-DCDS_DISABLE_64BIT_ATOMIC` - for 32bit build + +**All your projects AND libcds MUST be compiled with the same flags - either with DCAS support or without it.** + + **Pull request requirements** - Pull-request to *master* branch will be unconditionally rejected - *integration* branch is intended for pull-request. Usually, *integration* branch is the same as *master* -- 2.34.1