lfds700_misc_query

From liblfds.org
Revision as of 00:02, 25 December 2015 by Admin (talk | contribs) (→‎Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

└───liblfds700
    ├───inc
    │   └───liblfds700
    │           lfds700_misc.h
    └───src
        └───lfds700_liblfds
                lfds700_misc_query.c

Enums

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
};

Prototype

void lfds700_misc_query( enum lfds700_misc_query query_type,
                         void *query_input,
                         void *query_output );

Parameters

enum lfds700_misc_query query_type

Indicates which query to perform.

void *query_input

A pointer to data, or data cast to a void pointer, which is input data required by query indicated by query_type.

void *query_output

A pointer to store into which the requested information is placed, where the output data varies by the query indicted by query_type.

Queries

LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS

void *query_input
This argument is NULL
void *query_output
Points to a lfds700_pal_atom_t, which is set to the timeslot length in loop iterations for CAS.

LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_CAS

void *query_input
Points to a lfds700_pal_atom_t, where the timeslot length in loop iterations for CAS is set to the value it holds, and the value it holds is replaced by the previous value in use.
void *query_output
This argument is NULL

LFDS700_MISC_QUERY_GET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS

void *query_input
This argument is NULL
void *query_output
Points to a lfds700_pal_atom_t, which is set to the timeslot length in loop iterations for DWCAS.

LFDS700_MISC_QUERY_SET_EXPONENTIAL_BACKOFF_TIMESLOT_LENGTH_IN_LOOP_ITERATIONS_FOR_DWCAS

void *query_input
Points to a lfds700_pal_atom_t, where the timeslot length in loop iterations for DWCAS is set to the value it holds, and the value it holds is replaced by the previous value in use.
void *query_output
This argument is NULL

LFDS700_MISC_QUERY_GET_BUILD_AND_VERSION_STRING

void *query_input
This argument is NULL
void *query_output
Points to a char const *, which is set to point to the build and version string for the library. The build and version string is statically allocated within the library, and query_output is merely set to point to it; no copying occurs.

Notes

Please see Lock-Free Exponential Backoff for details regarding the timeslot length get/set functions.

Be aware that lfds700_misc_prng_state when instantiated create a local copy of the timeslot length values and setting new values using the queries above will not adjust the values in use by any existing lfds700_misc_prng_states, only by those instantiated after the set query returns.

See Also