3 #include "map/hdr_map.h"
4 #include <cds/urcu/signal_buffered.h>
5 #include <cds/container/michael_list_rcu.h>
6 #include <cds/container/split_list_map_rcu.h>
10 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
12 typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
14 struct RCU_SHB_cmp_traits: public cc::split_list::traits
16 typedef cc::michael_list_tag ordered_list;
17 typedef HashMapHdrTest::hash_int hash;
18 typedef HashMapHdrTest::simple_item_counter item_counter;
19 typedef cc::opt::v::relaxed_ordering memory_model;
20 enum { dynamic_bucket_table = false };
22 struct ordered_list_traits: public cc::michael_list::traits
24 typedef HashMapHdrTest::cmp compare;
28 struct RCU_SHB_less_traits: public cc::split_list::traits
30 typedef cc::michael_list_tag ordered_list;
31 typedef HashMapHdrTest::hash_int hash;
32 typedef HashMapHdrTest::simple_item_counter item_counter;
33 typedef cc::opt::v::sequential_consistent memory_model;
34 enum { dynamic_bucket_table = true };
36 struct ordered_list_traits: public cc::michael_list::traits
38 typedef HashMapHdrTest::less less;
42 struct RCU_cmpmix_traits: public cc::split_list::traits
44 typedef cc::michael_list_tag ordered_list;
45 typedef HashMapHdrTest::hash_int hash;
46 typedef HashMapHdrTest::simple_item_counter item_counter;
48 struct ordered_list_traits: public cc::michael_list::traits
50 typedef HashMapHdrTest::cmp compare;
51 typedef std::less<HashMapHdrTest::key_type> less;
55 struct RCU_cmpmix_stat_traits : public RCU_cmpmix_traits
57 typedef cc::split_list::stat<> stat;
62 void HashMapHdrTest::Split_RCU_SHB_cmp()
64 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
65 // traits-based version
66 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > map_type;
67 test_rcu< map_type >();
69 // option-based version
70 typedef cc::SplitListMap< rcu_type,
73 cc::split_list::make_traits<
74 cc::split_list::ordered_list<cc::michael_list_tag>
75 ,cc::opt::hash< hash_int >
76 ,cc::opt::item_counter< simple_item_counter >
77 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
78 ,cc::split_list::dynamic_bucket_table< true >
79 ,cc::split_list::ordered_list_traits<
80 cc::michael_list::make_traits<
81 cc::opt::compare< cmp >
86 test_rcu< opt_map >();
90 void HashMapHdrTest::Split_RCU_SHB_less()
92 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
93 // traits-based version
94 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHB_less_traits > map_type;
95 test_rcu< map_type >();
97 // option-based version
98 typedef cc::SplitListMap< rcu_type,
101 cc::split_list::make_traits<
102 cc::split_list::ordered_list<cc::michael_list_tag>
103 ,cc::opt::hash< hash_int >
104 ,cc::opt::item_counter< simple_item_counter >
105 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
106 ,cc::split_list::dynamic_bucket_table< false >
107 ,cc::split_list::ordered_list_traits<
108 cc::michael_list::make_traits<
109 cc::opt::less< less >
114 test_rcu< opt_map >();
118 void HashMapHdrTest::Split_RCU_SHB_cmpmix()
120 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
121 // traits-based version
122 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_traits > map_type;
123 test_rcu< map_type >();
125 // option-based version
126 typedef cc::SplitListMap< rcu_type,
129 cc::split_list::make_traits<
130 cc::split_list::ordered_list<cc::michael_list_tag>
131 ,cc::opt::hash< hash_int >
132 ,cc::opt::item_counter< simple_item_counter >
133 ,cc::split_list::ordered_list_traits<
134 cc::michael_list::make_traits<
135 cc::opt::less< std::less<key_type> >
136 ,cc::opt::compare< cmp >
141 test_rcu< opt_map >();
145 void HashMapHdrTest::Split_RCU_SHB_cmpmix_stat()
147 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
148 // traits-based version
149 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_cmpmix_stat_traits > map_type;
150 test_rcu< map_type >();
152 // option-based version
153 typedef cc::SplitListMap< rcu_type,
156 cc::split_list::make_traits<
157 cc::split_list::ordered_list<cc::michael_list_tag>
158 ,cc::opt::hash< hash_int >
159 ,cc::opt::item_counter< simple_item_counter >
160 ,cc::opt::stat<cc::split_list::stat<>>
161 ,cc::split_list::ordered_list_traits<
162 cc::michael_list::make_traits<
163 cc::opt::less< std::less<key_type> >
164 ,cc::opt::compare< cmp >
169 test_rcu< opt_map >();