]> pd.if.org Git - liblfds/blob - liblfds/liblfds6.0.0/test/src/structures.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds6.0.0 / test / src / structures.h
1 /***** structs *****/
2 #pragma pack( push, LFDS600_ALIGN_DOUBLE_POINTER )
3
4 /***** abstraction tests *****/
5 struct abstraction_test_dcas_state
6 {
7   volatile lfds600_atom_t
8     *shared_counter;
9
10   lfds600_atom_t
11     local_counter;
12 };
13
14 /***** freelist tests *****/
15 struct freelist_test_popping_state
16 {
17   struct lfds600_freelist_state
18     *fs,
19     *fs_thread_local;
20 };
21
22 struct freelist_test_pushing_state
23 {
24   lfds600_atom_t
25     thread_number;
26
27   struct lfds600_freelist_state
28     *source_fs,
29     *fs;
30 };
31
32 struct freelist_test_popping_and_pushing_state
33 {
34   struct lfds600_freelist_state
35     *local_fs,
36     *fs;
37 };
38
39 struct freelist_test_counter_and_thread_number
40 {
41   lfds600_atom_t
42     thread_number;
43
44   unsigned long long int
45     counter;
46 };
47
48 /***** queue tests *****/
49 struct queue_test_enqueuing_state
50 {
51   struct lfds600_queue_state
52     *qs;
53
54   lfds600_atom_t
55     counter;
56 };
57
58 struct queue_test_dequeuing_state
59 {
60   struct lfds600_queue_state
61     *qs;
62
63   int
64     error_flag;
65 };
66
67 struct queue_test_enqueuing_and_dequeuing_state
68 {
69   struct lfds600_queue_state
70     *qs;
71
72   lfds600_atom_t
73     counter,
74     thread_number,
75     *per_thread_counters;
76
77   unsigned int
78     cpu_count;
79
80   int
81     error_flag;
82 };
83
84 struct queue_test_rapid_enqueuing_and_dequeuing_state
85 {
86   struct lfds600_queue_state
87     *qs;
88
89   lfds600_atom_t
90     counter;
91 };
92
93 /***** ringbuffer tests *****/
94 struct ringbuffer_test_reading_state
95 {
96   struct lfds600_ringbuffer_state
97     *rs;
98
99   int
100     error_flag;
101
102   lfds600_atom_t
103     read_count;
104 };
105
106 struct ringbuffer_test_writing_state
107 {
108   struct lfds600_ringbuffer_state
109     *rs;
110
111   lfds600_atom_t
112     write_count;
113 };
114
115 struct ringbuffer_test_reading_and_writing_state
116 {
117   struct lfds600_ringbuffer_state
118     *rs;
119
120   lfds600_atom_t
121     counter,
122     *per_thread_counters;
123
124   unsigned int
125     cpu_count;
126
127   int
128     error_flag;
129 };
130
131 /***** slist tests *****/
132 struct lfds600_slist_thread_start_state
133 {
134   struct lfds600_slist_state
135     *ss;
136
137   struct lfds600_slist_element
138     *se;
139
140   time_t
141     duration;
142
143   unsigned long int
144     iteration_modulo;
145 };
146
147 /***** stack tests *****/
148
149 /***** freelist benchmarks *****/
150 struct lfds600_freelist_benchmark
151 {
152   struct lfds600_freelist_state
153     *fs;
154
155   lfds600_atom_t
156     operation_count;
157 };
158
159 /***** queue benchmarks *****/
160 struct lfds600_queue_benchmark
161 {
162   struct lfds600_queue_state
163     *qs;
164
165   lfds600_atom_t
166     operation_count;
167 };
168
169 /***** ringbuffer benchmarks *****/
170 struct lfds600_ringbuffer_benchmark
171 {
172   struct lfds600_ringbuffer_state
173     *rs;
174
175   lfds600_atom_t
176     operation_count;
177 };
178
179 /***** stack benchmarks *****/
180 struct lfds600_stack_benchmark
181 {
182   struct lfds600_stack_state
183     *ss;
184
185   lfds600_atom_t
186     operation_count;
187 };
188
189 #pragma pack( pop )
190