2 #include "libbenchmark_benchmarks_btree_au_internal.h"
5 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element
10 struct libbenchmark_datastructure_btree_au_pthread_mutex_element
14 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state
21 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_numa_benchmark_state
27 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element
30 struct libbenchmark_datastructure_btree_au_pthread_mutex_state
34 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_overall_benchmark_state
36 enum libbenchmark_topology_numa_mode
43 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element
46 struct libbenchmark_datastructure_btree_au_pthread_mutex_state
50 /***** private prototypes *****/
51 static int key_compare_function( void const *new_key, void const *existing_key );
57 /****************************************************************************/
58 void libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_init( struct libbenchmark_topology_state *ts,
59 struct lfds710_list_aso_state *logical_processor_set,
60 struct libshared_memory_state *ms,
61 enum libbenchmark_topology_numa_mode numa_mode,
62 struct libbenchmark_threadset_state *tsets )
64 enum libbenchmark_datastructure_btree_au_pthread_mutex_insert_result
70 number_logical_processors,
71 number_benchmark_elements,
72 number_logical_processors_in_numa_node,
73 largest_number_logical_processors_in_numa_node = 0,
74 total_number_benchmark_elements;
76 struct lfds710_list_asu_element
80 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_overall_benchmark_state
83 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_numa_benchmark_state
86 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state
89 struct libbenchmark_datastructure_btree_au_pthread_mutex_state
92 struct libbenchmark_prng_state
95 struct libbenchmark_threadset_per_numa_state
99 struct libbenchmark_threadset_per_thread_state
102 struct libbenchmark_topology_node_state
105 LFDS710_PAL_ASSERT( ts != NULL );
106 LFDS710_PAL_ASSERT( logical_processor_set != NULL );
107 LFDS710_PAL_ASSERT( ms != NULL );
108 // TRD : numa_mode can be any value in its range
109 LFDS710_PAL_ASSERT( tsets != NULL );
111 lfds710_list_aso_query( logical_processor_set, LFDS710_LIST_ASO_QUERY_GET_POTENTIALLY_INACCURATE_COUNT, NULL, (void *) &number_logical_processors );
113 libbenchmark_threadset_init( tsets, ts, logical_processor_set, ms, libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_thread, NULL );
115 total_number_benchmark_elements = number_logical_processors * 1024;
117 obs = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_overall_benchmark_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
119 LIBBENCHMARK_PRNG_INIT( ps, LFDS710_PRNG_SEED );
123 case LIBBENCHMARK_TOPOLOGY_NUMA_MODE_SMP:
124 bs = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(struct libbenchmark_datastructure_btree_au_pthread_mutex_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
125 libbenchmark_datastructure_btree_au_pthread_mutex_init( bs, key_compare_function, LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_EXISTING_KEY_FAIL, NULL );
127 obs->bme = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element) * total_number_benchmark_elements, LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
128 obs->element_key_array = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(lfds710_pal_uint_t) * total_number_benchmark_elements, sizeof(lfds710_pal_uint_t) );
130 for( loop = 0 ; loop < total_number_benchmark_elements ; loop++ )
133 LIBBENCHMARK_PRNG_GENERATE( ps, obs->bme[loop].datum );
134 obs->element_key_array[loop] = obs->bme[loop].datum;
136 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_KEY_IN_ELEMENT( *bs, obs->bme[loop].be, &obs->bme[loop] );
137 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_VALUE_IN_ELEMENT( *bs, obs->bme[loop].be, &obs->bme[loop] );
138 ir = libbenchmark_datastructure_btree_au_pthread_mutex_insert( bs, &obs->bme[loop].be, NULL );
140 while( ir == LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_INSERT_RESULT_FAILURE_EXISTING_KEY );
144 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue) )
146 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
147 ptbs = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
148 LIBBENCHMARK_PRNG_GENERATE( ps, ptbs->per_thread_prng_seed );
149 pts->users_per_thread_state = ptbs;
153 case LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA:
154 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_numa_states,lasue) )
156 pns = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
159 number_logical_processors_in_numa_node = 0;
161 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue_lp) )
163 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue_lp );
165 libbenchmark_topology_query( ts, LIBBENCHMARK_TOPOLOGY_QUERY_GET_NUMA_NODE_FOR_LOGICAL_PROCESSOR, pts->tns_lp, &numa_node_for_lp );
167 if( LIBBENCHMARK_TOPOLOGY_NODE_GET_NUMA_ID(*numa_node_for_lp) == pns->numa_node_id )
168 number_logical_processors_in_numa_node++;
171 if( number_logical_processors_in_numa_node > largest_number_logical_processors_in_numa_node )
175 bs = libshared_memory_alloc_from_specific_node( ms, largest_pns->numa_node_id, sizeof(struct libbenchmark_datastructure_btree_au_pthread_mutex_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
176 libbenchmark_datastructure_btree_au_pthread_mutex_init( bs, key_compare_function, LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_EXISTING_KEY_FAIL, NULL );
178 obs->element_key_array = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(lfds710_pal_uint_t) * total_number_benchmark_elements, sizeof(lfds710_pal_uint_t) );
182 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_numa_states,lasue) )
184 pns = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
186 /* TRD : for each NUMA node, figure out how many LPs in the current set are in that NUMA node
187 and allocate then the correct number of elements from this NUMA node (1024 per LP)
191 number_logical_processors_in_numa_node = 0;
193 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue_lp) )
195 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue_lp );
197 libbenchmark_topology_query( ts, LIBBENCHMARK_TOPOLOGY_QUERY_GET_NUMA_NODE_FOR_LOGICAL_PROCESSOR, pts->tns_lp, &numa_node_for_lp );
199 if( LIBBENCHMARK_TOPOLOGY_NODE_GET_NUMA_ID(*numa_node_for_lp) == pns->numa_node_id )
200 number_logical_processors_in_numa_node++;
203 number_benchmark_elements = number_logical_processors_in_numa_node * 1024;
205 ptns = libshared_memory_alloc_from_specific_node( ms, pns->numa_node_id, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_numa_benchmark_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
206 ptns->element_key_array = libshared_memory_alloc_from_specific_node( ms, pns->numa_node_id, sizeof(lfds710_pal_uint_t) * total_number_benchmark_elements, sizeof(lfds710_pal_uint_t) );
207 ptns->number_element_keys = total_number_benchmark_elements;
209 ptns->bme = libshared_memory_alloc_from_specific_node( ms, pns->numa_node_id, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element) * number_benchmark_elements, LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
211 for( loop = 0 ; loop < number_benchmark_elements ; loop++, index++ )
214 LIBBENCHMARK_PRNG_GENERATE( ps, ptns->bme[loop].datum );
215 obs->element_key_array[index] = ptns->bme[loop].datum;
217 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_KEY_IN_ELEMENT( *bs, ptns->bme[loop].be, &ptns->bme[loop] );
218 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_VALUE_IN_ELEMENT( *bs, ptns->bme[loop].be, &ptns->bme[loop] );
219 ir = libbenchmark_datastructure_btree_au_pthread_mutex_insert( bs, &ptns->bme[loop].be, NULL );
221 while( ir == LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_INSERT_RESULT_FAILURE_EXISTING_KEY );
223 pns->users_per_numa_state = ptns;
226 // TRD : now copy over into each NUMA node state the element_key_array
229 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_numa_states,lasue) )
231 pns = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
232 ptns = pns->users_per_numa_state;
234 for( loop = 0 ; loop < total_number_benchmark_elements ; loop++ )
235 ptns->element_key_array[loop] = obs->element_key_array[loop];
240 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue) )
242 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
243 ptbs = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
244 LIBBENCHMARK_PRNG_GENERATE( ps, ptbs->per_thread_prng_seed );
245 LIBBENCHMARK_PRNG_MURMURHASH3_MIXING_FUNCTION( ptbs->per_thread_prng_seed );
246 pts->users_per_thread_state = ptbs;
250 case LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA_BUT_NOT_USED:
251 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_numa_states,lasue) )
253 pns = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
256 number_logical_processors_in_numa_node = 0;
258 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue_lp) )
260 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue_lp );
262 libbenchmark_topology_query( ts, LIBBENCHMARK_TOPOLOGY_QUERY_GET_NUMA_NODE_FOR_LOGICAL_PROCESSOR, pts->tns_lp, &numa_node_for_lp );
264 if( LIBBENCHMARK_TOPOLOGY_NODE_GET_NUMA_ID(*numa_node_for_lp) == pns->numa_node_id )
265 number_logical_processors_in_numa_node++;
268 if( number_logical_processors_in_numa_node > largest_number_logical_processors_in_numa_node )
272 bs = libshared_memory_alloc_from_specific_node( ms, largest_pns->numa_node_id, sizeof(struct libbenchmark_datastructure_btree_au_pthread_mutex_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
273 libbenchmark_datastructure_btree_au_pthread_mutex_init( bs, key_compare_function, LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_EXISTING_KEY_FAIL, NULL );
275 obs->element_key_array = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(lfds710_pal_uint_t) * total_number_benchmark_elements, sizeof(lfds710_pal_uint_t) );
279 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_numa_states,lasue) )
281 pns = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
283 /* TRD : for each NUMA node, figure out how many LPs in the current set are in that NUMA node
284 and allocate then the correct number of elements from this NUMA node (1024 per LP)
288 number_logical_processors_in_numa_node = 0;
290 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue_lp) )
292 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue_lp );
294 libbenchmark_topology_query( ts, LIBBENCHMARK_TOPOLOGY_QUERY_GET_NUMA_NODE_FOR_LOGICAL_PROCESSOR, pts->tns_lp, &numa_node_for_lp );
296 if( LIBBENCHMARK_TOPOLOGY_NODE_GET_NUMA_ID(*numa_node_for_lp) == pns->numa_node_id )
297 number_logical_processors_in_numa_node++;
300 number_benchmark_elements = number_logical_processors_in_numa_node * 1024;
302 ptns = libshared_memory_alloc_from_specific_node( ms, pns->numa_node_id, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_numa_benchmark_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
303 ptns->element_key_array = libshared_memory_alloc_from_specific_node( ms, pns->numa_node_id, sizeof(lfds710_pal_uint_t) * total_number_benchmark_elements, sizeof(lfds710_pal_uint_t) );
304 ptns->number_element_keys = total_number_benchmark_elements;
306 // TRD : everyone stores their elements in the same NUMA node
307 ptns->bme = libshared_memory_alloc_from_specific_node( ms, largest_pns->numa_node_id, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element) * number_benchmark_elements, LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
309 for( loop = 0 ; loop < number_benchmark_elements ; loop++, index++ )
312 LIBBENCHMARK_PRNG_GENERATE( ps, ptns->bme[loop].datum );
313 obs->element_key_array[index] = ptns->bme[loop].datum;
315 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_KEY_IN_ELEMENT( *bs, ptns->bme[loop].be, &ptns->bme[loop] );
316 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_VALUE_IN_ELEMENT( *bs, ptns->bme[loop].be, &ptns->bme[loop] );
317 ir = libbenchmark_datastructure_btree_au_pthread_mutex_insert( bs, &ptns->bme[loop].be, NULL );
319 while( ir == LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_INSERT_RESULT_FAILURE_EXISTING_KEY );
321 pns->users_per_numa_state = ptns;
324 // TRD : now copy over into each NUMA node state the element_key_array
327 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_numa_states,lasue) )
329 pns = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
330 ptns = pns->users_per_numa_state;
332 for( loop = 0 ; loop < total_number_benchmark_elements ; loop++ )
333 ptns->element_key_array[loop] = obs->element_key_array[loop];
338 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue) )
340 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
341 ptbs = libshared_memory_alloc_from_most_free_space_node( ms, sizeof(struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state), LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES );
342 LIBBENCHMARK_PRNG_GENERATE( ps, ptbs->per_thread_prng_seed );
343 LIBBENCHMARK_PRNG_MURMURHASH3_MIXING_FUNCTION( ptbs->per_thread_prng_seed );
344 pts->users_per_thread_state = ptbs;
349 obs->number_element_keys = total_number_benchmark_elements;
351 obs->numa_mode = numa_mode;
353 tsets->users_threadset_state = obs;
362 /****************************************************************************/
363 libshared_pal_thread_return_t LIBSHARED_PAL_THREAD_CALLING_CONVENTION libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_thread( void *libbenchmark_threadset_per_thread_state )
365 int long long unsigned
368 time_units_per_second;
371 *element_key_array = NULL,
373 number_element_keys = 0,
378 struct libbenchmark_prng_state
381 struct libbenchmark_datastructure_btree_au_pthread_mutex_element
384 struct libbenchmark_datastructure_btree_au_pthread_mutex_state
387 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state
390 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_numa_benchmark_state
393 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_overall_benchmark_state
396 struct libbenchmark_threadset_per_thread_state
399 LFDS710_MISC_BARRIER_LOAD;
401 LFDS710_PAL_ASSERT( libbenchmark_threadset_per_thread_state != NULL );
403 pts = (struct libbenchmark_threadset_per_thread_state *) libbenchmark_threadset_per_thread_state;
405 ptbs = LIBBENCHMARK_THREADSET_PER_THREAD_STATE_GET_USERS_PER_THREAD_STATE( *pts );
406 obs = LIBBENCHMARK_THREADSET_PER_THREAD_STATE_GET_USERS_OVERALL_STATE( *pts );
407 if( obs->numa_mode == LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA or obs->numa_mode == LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA_BUT_NOT_USED )
408 pnbs = LIBBENCHMARK_THREADSET_PER_THREAD_STATE_GET_USERS_PER_NUMA_STATE( *pts );
412 LIBBENCHMARK_PRNG_INIT( ps, ptbs->per_thread_prng_seed );
414 LIBBENCHMARK_PAL_TIME_UNITS_PER_SECOND( &time_units_per_second );
416 switch( obs->numa_mode )
418 case LIBBENCHMARK_TOPOLOGY_NUMA_MODE_SMP:
419 element_key_array = obs->element_key_array;
420 number_element_keys = obs->number_element_keys;
423 case LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA:
424 element_key_array = pnbs->element_key_array;
425 number_element_keys = pnbs->number_element_keys;
428 case LIBBENCHMARK_TOPOLOGY_NUMA_MODE_NUMA_BUT_NOT_USED:
429 element_key_array = pnbs->element_key_array;
430 number_element_keys = pnbs->number_element_keys;
434 libbenchmark_threadset_thread_ready_and_wait( pts );
436 LIBBENCHMARK_PAL_GET_HIGHRES_TIME( ¤t_time );
438 end_time = current_time + time_units_per_second * libbenchmark_globals_benchmark_duration_in_seconds;
440 while( current_time < end_time )
442 LIBBENCHMARK_PRNG_GENERATE( ps, random_value );
443 index = random_value % number_element_keys;
446 libbenchmark_datastructure_btree_au_pthread_mutex_get_by_key( bs, NULL, &element_key_array[index], &existing_be );
447 // LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_GET_VALUE_FROM_ELEMENT( benchmark_state->bs, *existing_be, datum );
449 LIBBENCHMARK_PRNG_GENERATE( ps, random_value );
450 index = random_value % number_element_keys;
453 libbenchmark_datastructure_btree_au_pthread_mutex_get_by_key( bs, NULL, &element_key_array[index], &existing_be );
454 // LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_MUTEX_SET_VALUE_IN_ELEMENT( benchmark_state->bs, *existing_be, benchmark_state->benchmark_element_array[index].datum );
458 if( time_loop++ == TIME_LOOP_COUNT )
461 LIBBENCHMARK_PAL_GET_HIGHRES_TIME( ¤t_time );
465 ptbs->operation_count = operation_count;
467 LFDS710_MISC_BARRIER_STORE;
469 lfds710_misc_force_store();
471 return LIBSHARED_PAL_THREAD_RETURN_CAST(RETURN_SUCCESS);
478 /****************************************************************************/
479 void libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_cleanup( struct lfds710_list_aso_state *logical_processor_set,
480 enum libbenchmark_topology_numa_mode numa_mode,
481 struct libbenchmark_results_state *rs,
482 struct libbenchmark_threadset_state *tsets )
484 struct lfds710_list_asu_element
487 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_overall_benchmark_state
490 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_per_thread_benchmark_state
493 struct libbenchmark_threadset_per_thread_state
496 LFDS710_PAL_ASSERT( logical_processor_set != NULL );
497 // TRD : numa_mode can be any value in its range
498 LFDS710_PAL_ASSERT( rs != NULL );
499 LFDS710_PAL_ASSERT( tsets != NULL );
501 while( LFDS710_LIST_ASU_GET_START_AND_THEN_NEXT(tsets->list_of_per_thread_states,lasue) )
503 pts = LFDS710_LIST_ASU_GET_VALUE_FROM_ELEMENT( *lasue );
505 ptbs = LIBBENCHMARK_THREADSET_PER_THREAD_STATE_GET_USERS_PER_THREAD_STATE( *pts );
507 libbenchmark_results_put_result( rs,
508 LIBBENCHMARK_DATASTRUCTURE_ID_BTREE_AU,
509 LIBBENCHMARK_BENCHMARK_ID_READN_THEN_WRITEN,
510 LIBBENCHMARK_LOCK_ID_PTHREAD_MUTEX,
512 logical_processor_set,
513 LIBBENCHMARK_TOPOLOGY_NODE_GET_LOGICAL_PROCESSOR_NUMBER( *pts->tns_lp ),
514 LIBBENCHMARK_TOPOLOGY_NODE_GET_WINDOWS_GROUP_NUMBER( *pts->tns_lp ),
515 ptbs->operation_count );
518 obs = tsets->users_threadset_state;;
520 libbenchmark_datastructure_btree_au_pthread_mutex_cleanup( obs->bs, NULL );
529 /****************************************************************************/
530 static int key_compare_function( void const *new_key, void const *existing_key )
532 struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element
533 *new_benchmark_element,
534 *existing_benchmark_element;
536 LFDS710_PAL_ASSERT( new_key != NULL );
537 LFDS710_PAL_ASSERT( existing_key != NULL );
539 new_benchmark_element = (struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element *) new_key;
540 existing_benchmark_element = (struct libbenchmark_benchmark_btree_au_pthread_mutex_readn_writen_benchmark_element *) existing_key;
542 if( new_benchmark_element->datum < existing_benchmark_element->datum )
545 if( new_benchmark_element->datum > existing_benchmark_element->datum )