]> pd.if.org Git - liblfds/blob - liblfds/liblfds6.1.0/test/src/structures.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds6.1.0 / test / src / structures.h
1 /***** structs *****/
2 #pragma pack( push, LFDS610_ALIGN_DOUBLE_POINTER )
3
4 /***** abstraction tests *****/
5 struct abstraction_test_cas_state
6 {
7   volatile lfds610_atom_t
8     *shared_counter;
9
10   lfds610_atom_t
11     local_counter;
12 };
13
14 struct abstraction_test_dcas_state
15 {
16   volatile lfds610_atom_t
17     *shared_counter;
18
19   lfds610_atom_t
20     local_counter;
21 };
22
23 /***** freelist tests *****/
24 struct freelist_test_popping_state
25 {
26   struct lfds610_freelist_state
27     *fs,
28     *fs_thread_local;
29 };
30
31 struct freelist_test_pushing_state
32 {
33   lfds610_atom_t
34     *count,
35     thread_number;
36
37   struct lfds610_freelist_state
38     *source_fs,
39     *fs;
40 };
41
42 struct freelist_test_popping_and_pushing_state
43 {
44   struct lfds610_freelist_state
45     *local_fs,
46     *fs;
47 };
48
49 struct freelist_test_counter_and_thread_number
50 {
51   lfds610_atom_t
52     thread_number;
53
54   unsigned long long int
55     counter;
56 };
57
58 /***** queue tests *****/
59 struct queue_test_enqueuing_state
60 {
61   struct lfds610_queue_state
62     *qs;
63
64   lfds610_atom_t
65     counter;
66 };
67
68 struct queue_test_dequeuing_state
69 {
70   struct lfds610_queue_state
71     *qs;
72
73   int
74     error_flag;
75 };
76
77 struct queue_test_enqueuing_and_dequeuing_state
78 {
79   struct lfds610_queue_state
80     *qs;
81
82   lfds610_atom_t
83     counter,
84     thread_number,
85     *per_thread_counters;
86
87   unsigned int
88     cpu_count;
89
90   int
91     error_flag;
92 };
93
94 struct queue_test_rapid_enqueuing_and_dequeuing_state
95 {
96   struct lfds610_queue_state
97     *qs;
98
99   lfds610_atom_t
100     counter;
101 };
102
103 /***** ringbuffer tests *****/
104 struct ringbuffer_test_reading_state
105 {
106   struct lfds610_ringbuffer_state
107     *rs;
108
109   int
110     error_flag;
111
112   lfds610_atom_t
113     read_count;
114 };
115
116 struct ringbuffer_test_writing_state
117 {
118   struct lfds610_ringbuffer_state
119     *rs;
120
121   lfds610_atom_t
122     write_count;
123 };
124
125 struct ringbuffer_test_reading_and_writing_state
126 {
127   struct lfds610_ringbuffer_state
128     *rs;
129
130   lfds610_atom_t
131     counter,
132     *per_thread_counters;
133
134   unsigned int
135     cpu_count;
136
137   int
138     error_flag;
139 };
140
141 /***** slist tests *****/
142 struct slist_test_state
143 {
144   struct lfds610_slist_state
145     *ss;
146
147   size_t
148     create_count,
149     delete_count;
150
151   lfds610_atom_t
152     thread_and_count;
153 };
154
155 /***** stack tests *****/
156 struct stack_test_popping_state
157 {
158   struct lfds610_stack_state
159     *ss,
160     *ss_thread_local;
161 };
162
163 struct stack_test_pushing_state
164 {
165   lfds610_atom_t
166     thread_number;
167
168   struct lfds610_stack_state
169     *ss;
170 };
171
172 struct stack_test_popping_and_pushing_state
173 {
174   struct lfds610_stack_state
175     *local_ss,
176     *ss;
177 };
178
179 struct stack_test_counter_and_thread_number
180 {
181   lfds610_atom_t
182     thread_number,
183     counter;
184 };
185
186 /***** freelist benchmarks *****/
187 struct lfds610_freelist_benchmark
188 {
189   struct lfds610_freelist_state
190     *fs;
191
192   lfds610_atom_t
193     operation_count;
194 };
195
196 /***** queue benchmarks *****/
197 struct lfds610_queue_benchmark
198 {
199   struct lfds610_queue_state
200     *qs;
201
202   lfds610_atom_t
203     operation_count;
204 };
205
206 /***** ringbuffer benchmarks *****/
207 struct lfds610_ringbuffer_benchmark
208 {
209   struct lfds610_ringbuffer_state
210     *rs;
211
212   lfds610_atom_t
213     operation_count;
214 };
215
216 /***** stack benchmarks *****/
217 struct lfds610_stack_benchmark
218 {
219   struct lfds610_stack_state
220     *ss;
221
222   lfds610_atom_t
223     operation_count;
224 };
225
226 #pragma pack( pop )
227