function lfds711_prng_init_valid_on_current_logical_core

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_prng.h
    └───src
        └───lfds711_stack
                lfds711_prng_init.c

Opaque Structures

struct lfds711_prng_state;

Prototype

void lfds711_prng_init_valid_on_current_logical_core( struct lfds711_prng_state *ps, lfds711_pal_uint_t seed );

Parameters

struct lfds711_prng_state *ps

A pointer to a user-allocated LFDS711_PAL_ATOMIC_ISOLATION_IN_BYTES aligned struct lfds711_prng_state. Stack declared variables will automatically be correctly aligned by the compiler, due to the information in the structure definitions; nothing has to be done. Heap allocated variables however will by no means be correctly aligned and an aligned malloc must be used.

lfds711_pal_uint_t seed

A value used to generate the starting index into the sequence of numbers generated by the PRNG. This is not a literal index, but rather is a first input into the PRNG function. It can be any value in its range (i.e. including zero, a value not permitted by some classes of PRNGs).

Notes

As the function name indicates, the initialization work performed on the freelist state is only valid on the current logical core. To make this work valid on other logical cores, threads on other cores must call LFDS711_MISC_MAKE_VALID_ON_CURRENT_LOGICAL_CORE_INITS_COMPLETED_BEFORE_NOW_ON_ANY_OTHER_LOGICAL_CORE.

The convenience define LFDS711_PRNG_SEED is provided for use as a seed value.

Example

None yet.

See Also