Fixed make_comparator metafunction
[libcds.git] / cds / container / segmented_queue.h
index 59104fa94cbec5a93975fd104107ddf57c792073..48c26d6607e83dcf0466a1d218e3864bc1f35556 100644 (file)
@@ -1,7 +1,7 @@
 //$$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
@@ -47,7 +47,11 @@ namespace cds { namespace container {
             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 };
 
@@ -55,7 +59,7 @@ namespace cds { namespace container {
             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;
@@ -167,9 +171,9 @@ namespace cds { namespace container {
         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.
     */
@@ -197,7 +201,7 @@ namespace cds { namespace container {
         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
@@ -390,4 +394,4 @@ namespace cds { namespace container {
 
 }} // namespace cds::container
 
-#endif // #ifndef __CDS_CONTAINER_SEGMENTED_QUEUE_H
+#endif // #ifndef CDSLIB_CONTAINER_SEGMENTED_QUEUE_H