ck_pr_fence_atomic_store(3)

ck_pr_fence_atomic_store3

Enforce ordering of atomic read-modify-write operations to store operations

Usage

#include <ck_pr.h>

void

ck_pr_fence_atomic_store(void);

void

ck_pr_fence_strict_atomic_store(void);

Library

Concurrency Kit (libck, -lck)

Overview

The ck_pr_fence_atomic_store() function enforces the ordering of any atomic read-modify-write operations relative to any store operations following the function invocation. This function always serve as an implicit compiler barrier. On architectures implementing CK_MD_TSO, this operation only serves as a compiler barrier and no fences are emitted. To force the unconditional emission of a fence, use ck_pr_fence_strict_atomic_store().

Examples

#include <ck_pr.h>
static int a = 0;
static int b = 0;
void
function(void)
{
	int c;
	ck_pr_fas_int(&a, 1);
	/*
	 * Guarantee that the update to a is completed
	 * with respect to the store into the value pointed
	 * to by b.
	 */
	ck_pr_fence_atomic_store();
	c = ck_pr_store_int(&b, 2);
	return;
}

Return values

This function has no return value.

Releases

5 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8
  2. 9
  3. 11–12
  4. 13

From libck-dev 0.7.2-6 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.