X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cds%2Fopt%2Foptions.h;h=70faba7178a6c1a36a4630730072d2cc666aeb31;hb=ec53bf39af3914a93bd1f53fa8657d5f87583d01;hp=f740f024001a5463662a21fdf312b217df136435;hpb=f3d187182434846ab9608307037258421101feb9;p=libcds.git diff --git a/cds/opt/options.h b/cds/opt/options.h index f740f024..70faba71 100644 --- a/cds/opt/options.h +++ b/cds/opt/options.h @@ -1,11 +1,11 @@ /* This file is a part of libcds - Concurrent Data Structures library - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017 Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -304,15 +304,16 @@ namespace opt { Predefined option \p Type: - \p atomicity::empty_item_counter - no item counting performed. It is default policy for many containers - - \p atomicity::item_counter - the class that provides atomically item counting - - \p opt::v::sequential_item_counter - simple non-atomic item counter. This item counter is not intended for + - \p atomicity::item_counter - the class that provides atomic item counting + - \p atomicity::cache_friendly_item_counter - cache-friendly atomic item counter + - \p opt::v::sequential_item_counter - simple non-atomic item counter. This counter is not intended for concurrent containers and may be used only if it is explicitly noted. You may provide other implementation of \p atomicity::item_counter interface for your needs. Note, the item counting in lock-free containers cannot be exact; for example, if item counter for a container returns zero it is not mean that the container is empty. - Thus, the item counter may be used for statistical purposes only. + So, the item counter may be used for statistical purposes only. */ template struct item_counter { @@ -372,7 +373,7 @@ namespace opt { /// Apply padding only for tiny data when data size is less than required padding /** - The flag means that if your data size is less than the casheline size, the padding is applyed. + The flag means that if your data size is less than the cacheline size, the padding is applyed. Otherwise no padding will be applyed. This flag is applyed for padding value: @@ -404,6 +405,26 @@ namespace opt { //@endcond }; + //@cond + template + struct actual_padding + { + enum { value = Padding & ~padding_flags }; + }; + + template <> + struct actual_padding + { + enum { value = cds::c_nCacheLineSize }; + }; + + template <> + struct actual_padding + { + enum { value = cds::c_nCacheLineSize }; + }; + //@endcond + //@cond namespace details { enum padding_vs_datasize { @@ -688,6 +709,20 @@ namespace opt { //@endcond }; + /// [type-option] Free-list implementation + /** + See \p cds::intrusive::FreeList for free-list interface + */ + template + struct free_list { + //@cond + template struct pack: public Base + { + typedef FreeList free_list; + }; + //@endcond + }; + //@cond // For internal use template @@ -881,7 +916,6 @@ namespace cds { namespace opt { return (result_type) std::rand(); } }; - } // namespace v }} // namespace cds::opt