2 #define LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_GET_KEY_FROM_ELEMENT( btree_au_state, btree_au_element ) ( (btree_au_element).key )
3 #define LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_SET_KEY_IN_ELEMENT( btree_au_state, btree_au_element, new_key ) ( (btree_au_element).key = (void *) (lfds710_pal_uint_t) (new_key) )
4 #define LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_GET_VALUE_FROM_ELEMENT( btree_au_state, btree_au_element, existing_value ) { LIBBENCHMARK_PAL_LOCK_PTHREAD_RWLOCK_GET_READ((btree_au_state).lock); (existing_value) = (btree_au_element).value; LIBBENCHMARK_PAL_LOCK_PTHREAD_RWLOCK_RELEASE((btree_au_state).lock); }
5 #define LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_SET_VALUE_IN_ELEMENT( btree_au_state, btree_au_element, new_value ) { LIBBENCHMARK_PAL_LOCK_PTHREAD_RWLOCK_GET_WRITE((btree_au_state).lock); (btree_au_element).value = (void *) (lfds710_pal_uint_t) (new_value); LIBBENCHMARK_PAL_LOCK_PTHREAD_RWLOCK_RELEASE((btree_au_state).lock); }
6 #define LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_GET_USER_STATE_FROM_STATE( btree_au_state ) ( (btree_au_state).user_state )
9 enum libbenchmark_datastructure_btree_au_pthread_rwlock_absolute_position
11 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_ABSOLUTE_POSITION_ROOT,
12 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_ABSOLUTE_POSITION_SMALLEST_IN_TREE,
13 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_ABSOLUTE_POSITION_LARGEST_IN_TREE
16 enum libbenchmark_datastructure_btree_au_pthread_rwlock_existing_key
18 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_EXISTING_KEY_OVERWRITE,
19 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_EXISTING_KEY_FAIL
22 enum libbenchmark_datastructure_btree_au_pthread_rwlock_insert_result
24 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_INSERT_RESULT_FAILURE_EXISTING_KEY,
25 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_INSERT_RESULT_SUCCESS_OVERWRITE,
26 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_INSERT_RESULT_SUCCESS
29 enum libbenchmark_datastructure_btree_au_pthread_rwlock_relative_position
31 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_UP,
32 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_LEFT,
33 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_RIGHT,
34 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_SMALLEST_ELEMENT_BELOW_CURRENT_ELEMENT,
35 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_LARGEST_ELEMENT_BELOW_CURRENT_ELEMENT,
36 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_NEXT_SMALLER_ELEMENT_IN_ENTIRE_TREE,
37 LIBBENCHMARK_DATASTRUCTURE_BTREE_AU_PTHREAD_RWLOCK_RELATIVE_POSITION_NEXT_LARGER_ELEMENT_IN_ENTIRE_TREE
41 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element
43 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element
53 struct libbenchmark_datastructure_btree_au_pthread_rwlock_state
55 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element
58 pal_lock_pthread_rwlock_state LFDS710_PAL_ALIGN(LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES)
62 (*key_compare_function)( void const *new_key, void const *existing_key );
64 enum libbenchmark_datastructure_btree_au_pthread_rwlock_existing_key
71 /***** public prototypes *****/
72 void libbenchmark_datastructure_btree_au_pthread_rwlock_init( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
73 int (*key_compare_function)(void const *new_key, void const *existing_key),
74 enum libbenchmark_datastructure_btree_au_pthread_rwlock_existing_key existing_key,
77 void libbenchmark_datastructure_btree_au_pthread_rwlock_cleanup( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
78 void (*element_cleanup_callback)(struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus, struct libbenchmark_datastructure_btree_au_pthread_rwlock_element *baue) );
80 enum libbenchmark_datastructure_btree_au_pthread_rwlock_insert_result libbenchmark_datastructure_btree_au_pthread_rwlock_insert( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
81 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element *baue,
82 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element **existing_baue );
84 int libbenchmark_datastructure_btree_au_pthread_rwlock_get_by_key_for_read( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
85 int (*key_compare_function)(void const *new_key, void const *existing_key),
87 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element **baue );
89 int libbenchmark_datastructure_btree_au_pthread_rwlock_get_by_key_for_write( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
90 int (*key_compare_function)(void const *new_key, void const *existing_key),
92 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element **baue );
94 int libbenchmark_datastructure_btree_au_pthread_rwlock_get_by_absolute_position_and_then_by_relative_position_for_read( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
95 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element **baue,
96 enum libbenchmark_datastructure_btree_au_pthread_rwlock_absolute_position absolute_position,
97 enum libbenchmark_datastructure_btree_au_pthread_rwlock_relative_position relative_position );
99 int libbenchmark_datastructure_btree_au_pthread_rwlock_get_by_absolute_position_for_read( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
100 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element **baue,
101 enum libbenchmark_datastructure_btree_au_pthread_rwlock_absolute_position absolute_position );
103 int libbenchmark_datastructure_btree_au_pthread_rwlock_get_by_relative_position_for_read( struct libbenchmark_datastructure_btree_au_pthread_rwlock_state *baus,
104 struct libbenchmark_datastructure_btree_au_pthread_rwlock_element **baue,
105 enum libbenchmark_datastructure_btree_au_pthread_rwlock_relative_position relative_position );