//$$CDS-header$$
-#ifndef __CDS_CONTAINER_SEGMENTED_QUEUE_H
-#define __CDS_CONTAINER_SEGMENTED_QUEUE_H
+#ifndef CDSLIB_CONTAINER_SEGMENTED_QUEUE_H
+#define CDSLIB_CONTAINER_SEGMENTED_QUEUE_H
#include <memory>
#include <functional> // ref
enum { alignment = opt::cache_line_alignment };
/// Padding of segment data, default is no special padding
- /** @copydetails cds::intrusive::segmented_queue::traits::padding
+ /**
+ The segment is just an array of atomic data pointers,
+ so, the high load leads to false sharing and performance degradation.
+ A padding of segment data can eliminate false sharing issue.
+ On the other hand, the padding leads to increase segment size.
*/
enum { padding = cds::intrusive::segmented_queue::traits::padding };
typedef CDS_DEFAULT_ALLOCATOR allocator;
/// Lock type used to maintain an internal list of allocated segments
- typedef cds::lock::Spin lock_type;
+ typedef cds::sync::spin lock_type;
/// Random \ref cds::opt::permutation_generator "permutation generator" for sequence [0, quasi_factor)
typedef cds::opt::v::random2_permutation<int> permutation_generator;
quasi factor. It means that the consumer dequeues any item from the current first segment.
Template parameters:
- - \p GC - a garbage collector, possible types are cds::gc::HP, cds::gc::PTB
+ - \p GC - a garbage collector, possible types are cds::gc::HP, cds::gc::DHP
- \p T - the type of values stored in the queue
- - \p Traits - queue type traits, default is \p segmented_queue::type_traits.
+ - \p Traits - queue type traits, default is \p segmented_queue::traits.
\p segmented_queue::make_traits metafunction can be used to construct your
type traits.
*/
typedef typename base_class::lock_type lock_type ; ///< Type of mutex for maintaining an internal list of allocated segments.
typedef typename base_class::permutation_generator permutation_generator; ///< Random permutation generator for sequence [0, quasi-factor)
- static const size_t m_nHazardPtrCount = base_class::m_nHazardPtrCount ; ///< Count of hazard pointer required for the algorithm
+ static const size_t c_nHazardPtrCount = base_class::c_nHazardPtrCount ; ///< Count of hazard pointer required for the algorithm
protected:
//@cond
}} // namespace cds::container
-#endif // #ifndef __CDS_CONTAINER_SEGMENTED_QUEUE_H
+#endif // #ifndef CDSLIB_CONTAINER_SEGMENTED_QUEUE_H