CK_PR_FENCE_ATOMIC_STORE(3)
π CK_PR_FENCE_ATOMIC_STORE(3) π
okay bestie, you're in section 3 of the manual (the library-call girlies section π), and this page is literally about ck_pr_fence_atomic_store β enforce ordering of atomic read-modify-write operations to store operations. say it with me. slay. β¨
πΈ LIBRARY πΈ
Concurrency Kit, aka libck, aka the bestie you link with using -lck. π
β¨ SYNOPSIS β¨
#include <ck_pr.h>
void
ck_pr_fence_atomic_store(void);
void
ck_pr_fence_strict_atomic_store(void);
two icons, one header. no cap. π«Ά
π DESCRIPTION π
so here's the vibe. 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. it's giving boundaries. π
it always serves as an implicit compiler barrier. periodt. π§
but okay, plot twist: on architectures implementing CK_MD_TSO, this operation only serves as a compiler barrier and no fences are emitted. like, the hardware already had your back, so it's lowkey chilling. π
and if you're the kind of main character who wants to force the unconditional emission of a fence? that's what ck_pr_fence_strict_atomic_store() is for. use it when you need it fr fr. π₯
π¦ EXAMPLE π¦
#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;
}
not the comment in the middle explaining the entire plot π iconic. the fence is the moment where a's update is done before anything touches what b points to. obsessed. π
β RETURN VALUES β
This function has no return value. literally returns nothing. gives nothing but vibes and ordering guarantees. π
π SEE ALSO π
the whole friend group, all in one place:
ck_pr_stall(3)ck_pr_fence_atomic(3)ck_pr_fence_atomic_load(3)ck_pr_fence_store(3)ck_pr_fence_load(3)ck_pr_fence_load_atomic(3)ck_pr_fence_load_store(3)ck_pr_fence_load_depends(3)ck_pr_fence_memory(3)ck_pr_barrier(3)ck_pr_fas(3)ck_pr_load(3)ck_pr_store(3)ck_pr_faa(3)ck_pr_inc(3)ck_pr_dec(3)ck_pr_neg(3)ck_pr_not(3)ck_pr_add(3)ck_pr_sub(3)ck_pr_and(3)ck_pr_or(3)ck_pr_xor(3)ck_pr_cas(3)ck_pr_btc(3)ck_pr_bts(3)ck_pr_btr(3)
Additional information available at http://concurrencykit.org/ πβ¨
ok that's the whole page bestie, go forth and fence responsibly π«Ά
mwah π this was the CK_PR_FENCE_ATOMIC_STORE(3) page, dated May 16, 2013 β yeah she's vintage, she's still that girl, and she ate. bye pookie ππ
π¦ where this page comes from
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian trixie: libck-dev 0.7.2-6 Β· BSD-2-Clause
- epel 10: ck-devel 0.7.2-1.el10_1 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- nixos 26.05: ck 0.7.2
- nixpkgs unstable: ck 0.7.2
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu questing: libck-dev 0.7.2-5ubuntu1
- ubuntu resolute: libck-dev 0.7.2-5ubuntu2 Β· BSD-2-Clause
- ubuntu stonking: libck-dev 0.7.2-11 Β· BSD-2-Clause
- Copyright 2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms