3 #include "map/hdr_map.h"
4 #include <cds/urcu/signal_threaded.h>
5 #include <cds/container/lazy_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_threaded<> > rcu_type;
14 struct RCU_SHT_cmp_traits: public cc::split_list::type_traits
16 typedef cc::lazy_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::lazy_list::type_traits
24 typedef HashMapHdrTest::cmp compare;
28 struct RCU_SHT_less_traits: public cc::split_list::type_traits
30 typedef cc::lazy_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::lazy_list::type_traits
38 typedef HashMapHdrTest::less less;
42 struct RCU_SHT_cmpmix_traits: public cc::split_list::type_traits
44 typedef cc::lazy_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::lazy_list::type_traits
50 typedef HashMapHdrTest::cmp compare;
51 typedef std::less<HashMapHdrTest::key_type> less;
57 void HashMapHdrTest::Split_Lazy_RCU_SHT_cmp()
59 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
60 // traits-based version
61 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > map_type;
62 test_rcu< map_type >();
64 // option-based version
65 typedef cc::SplitListMap< rcu_type,
68 cc::split_list::make_traits<
69 cc::split_list::ordered_list<cc::lazy_list_tag>
70 ,cc::opt::hash< hash_int >
71 ,cc::opt::item_counter< simple_item_counter >
72 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
73 ,cc::split_list::dynamic_bucket_table< true >
74 ,cc::split_list::ordered_list_traits<
75 cc::lazy_list::make_traits<
76 cc::opt::compare< cmp >
81 test_rcu< opt_map >();
85 void HashMapHdrTest::Split_Lazy_RCU_SHT_less()
87 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
88 // traits-based version
89 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_less_traits > map_type;
90 test_rcu< map_type >();
92 // option-based version
93 typedef cc::SplitListMap< rcu_type,
96 cc::split_list::make_traits<
97 cc::split_list::ordered_list<cc::lazy_list_tag>
98 ,cc::opt::hash< hash_int >
99 ,cc::opt::item_counter< simple_item_counter >
100 ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
101 ,cc::split_list::dynamic_bucket_table< false >
102 ,cc::split_list::ordered_list_traits<
103 cc::lazy_list::make_traits<
104 cc::opt::less< less >
109 test_rcu< opt_map >();
113 void HashMapHdrTest::Split_Lazy_RCU_SHT_cmpmix()
115 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
116 // traits-based version
117 typedef cc::SplitListMap< rcu_type, key_type, value_type, RCU_SHT_cmpmix_traits > map_type;
118 test_rcu< map_type >();
120 // option-based version
121 typedef cc::SplitListMap< rcu_type,
124 cc::split_list::make_traits<
125 cc::split_list::ordered_list<cc::lazy_list_tag>
126 ,cc::opt::hash< hash_int >
127 ,cc::opt::item_counter< simple_item_counter >
128 ,cc::split_list::ordered_list_traits<
129 cc::lazy_list::make_traits<
130 cc::opt::less< std::less<key_type> >
131 ,cc::opt::compare< cmp >
136 test_rcu< opt_map >();