ck_pr_fence_store_load(3) enforce ordering of store operations to load operations

LIBRARY

Concurrency Kit (libck, -lck)

SYNOPSIS

In ck_pr.h Ft void Fn ck_pr_fence_store_load void Ft void Fn ck_pr_fence_strict_store_load void

DESCRIPTION

The Fn ck_pr_fence_store_load function enfores the ordering of any memory store, Fn ck_pr_store and atomic read-modify-write operations to load operations relative to the invocation of the function. This function always serve as an implicit compiler barrier. A fence will currently always be emitted for this operation, including for TSO memory model targets.

EXAMPLE

#include <ck_pr.h>
static int a = 0;
static int b = 0;
void
function(void)
{
        unsigned int snapshot_b;
        ck_pr_store_int(&a, 1);
        /*
         * Guarantee that the store to a is completed
         * with respect to load from b.
         */
        ck_pr_fence_store_load();
        snapshot_b = ck_pr_load_int(&b, 2);
        return;
}

RETURN VALUES

This function has no return value.