ck_pr_fence_store_load3
Enforce ordering of store operations to load operations
Usage
#include <ck_pr.h>
void
ck_pr_fence_store_load(void);
void
ck_pr_fence_strict_store_load(void);
Library
Concurrency Kit (libck, -lck)
Overview
The ck_pr_fence_store_load() function enforces the ordering of any memory store, 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.
Examples
#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.
Releases
5 releases since Debian 8 (Jessie); the text changed 2 times.