function lfds710_list_asu_init_valid_on_current_logical_core

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds710
    ├───inc
    │   └───liblfds710
    │           lfds710_list_addonly_singlylinked_unordered.h
    └───src
        └───llfds710_list_addonly_singlylinked_unordered
                lfds710_list_addonly_singlylinked_unordered_init.c

Opaque Structures

struct lfds710_list_asu_element;
struct lfds710_list_asu_state;

Prototype

void lfds710_list_asu_init_valid_on_current_logical_core( struct lfds710_list_asu_state *lasus,
                                                          void *user_state );

Parameters

struct lfds710_list_asu_state *lasus

A pointer to a user-allocated LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES aligned struct lfds710_list_asu_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.

void *user_state

A pointer to void, supplied by the user, which is returned to the user in various callback functions, permitting the user to pass his own state into those functions. This argument can be NULL.

Notes

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

This function instantiates an add-only, singly-linked, unordered list by initializing the list state. The caller is responsible for all memory allocation and, after lfds710_list_asu_cleanup is called, for all deallocation.

See Also