Misc
Jump to navigation
Jump to search
Source Files
└───liblfds700 ├───inc │ └───liblfds700 │ lfds700_misc.h └───src └───lfds700_misc lfds700_misc_cleanup.c lfds700_misc_globals.c lfds700_misc_init.c lfds700_misc_prng.c lfds700_misc_query.c
Defines
#define LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE #define LFDS700_MISC_PRNG_SEED
Enums
enum lfds700_misc_cas_strength { LFDS700_MISC_CAS_STRENGTH_WEAK, LFDS700_MISC_CAS_STRENGTH_STRONG }; enum lfds700_misc_flag { LFDS700_MISC_FLAG_LOWERED, LFDS700_MISC_FLAG_RAISED }; enum lfds700_misc_validity { LFDS700_MISC_VALIDITY_VALID, LFDS700_MISC_VALIDITY_INVALID_LOOP, LFDS700_MISC_VALIDITY_INVALID_MISSING_ELEMENTS, LFDS700_MISC_VALIDITY_INVALID_ADDITIONAL_ELEMENTS, LFDS700_MISC_VALIDITY_INVALID_TEST_DATA, LFDS700_MISC_VALIDITY_INVALID_ORDER }; enum lfds700_misc_query { LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS, LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS, LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS, LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS, LFDS700_MISC_QUERY_GET_BUILD_AND_VERSION_STRING };
Structures
struct lfds700_misc_validation_info { lfds700_pal_uint_t min_elements, max_elements; };
Opaque Structures
struct lfds700_misc_prng_state;
Prototypes
void lfds700_misc_library_init_valid_on_current_logical_core( void ); void lfds700_misc_library_cleanup( void ); void lfds700_misc_prng_init( struct lfds700_misc_prng_state *ps ); void lfds700_misc_query( enum lfds700_misc_query query_type, void *query_input, void *query_output );
Overview
This API is not a data structure but rather a set of support functions, for initiaizing and cleaning up the library, and for random number generation (which is vital for dealing with live-lock).
Lock-free Specific Behaviour
The state initialization function, lfds700_misc_library_init_valid_on_current_logical_core, as the same suggests, initializes the state structure but that initialization is only valid on the current logical core. For the initialization to be valid on other logical cores (i.e. other threads where they are running on other logical cores) those other threads need to call the long-windedly named macro LFDS700_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE, which will do that which its name suggests.