CK_PR_FENCE_LOAD(3)
π ck_pr_fence_load(3) β the manual page bestie π
okay so you're here for ck_pr_fence_load(3), which lives in the Concurrency Kit and is giving "make my loads behave" energy. no cap.
β¨ NAME β¨
ck_pr_fence_load β enforce partial ordering of load operations. yes queen, it's a fence, but for loads specifically. π¦
πΈ LIBRARY πΈ
Concurrency Kit (libck, -lck). that's the one you link, mwah. π
π SYNOPSIS π
#include <ck_pr.h>
void
ck_pr_fence_load(void);
void
ck_pr_fence_strict_load(void);
two functions, both return nothing, both iconic in their own way. π
π DESCRIPTION π
so here's the tea. ck_pr_fence_load() enforces the ordering of any memory load and ck_pr_load(3) operations relative to the moment you call it. translation: stuff you load after the fence doesn't get to jump in front of the fence. nope. line's closed. π§
also β any store operations that were committed on remote processors and received by the calling processor before the invocation of ck_pr_fence_load() get made visible only after a call to ck_pr_fence_load(). so the vibes stay in order, fr fr.
this function always serves as an implicit compiler barrier. periodt. the compiler cannot reorder across it, no discussion.
now for the architecture lore π β on architectures with CK_MD_TSO or CK_MD_PSO specified (total store ordering and partial store ordering respectively), this operation only serves as a compiler barrier and no fence instructions will be emitted. so if you were expecting an actual fence instruction, bestie, you're not getting one there. π
to force the unconditional emission of a load fence, use ck_pr_fence_strict_load(). that one does not play.
architectures implementing CK_MD_RMO always emit a load fence. no exceptions, main character energy. π₯
π§ EXAMPLE π§
#include <ck_pr.h>
static unsigned int a;
static unsigned int b;
void
function(void)
{
unsigned int snapshot_a, snapshot_b;
snapshot_a = ck_pr_load_uint(&a);
/*
* Guarantee that the load from "a" completes
* before the load from "b".
*/
ck_pr_fence_load();
snapshot_b = ck_pr_load_uint(&b);
return;
}
see how the fence sits between the two loads? that's the whole plot. π
β RETURN VALUES β
This function has no return value. it just does the thing and leaves. zero notes. π
π SEE ALSO π
ck_pr_stall(3)ck_pr_fence_atomic(3)ck_pr_fence_atomic_store(3)ck_pr_fence_atomic_load(3)ck_pr_fence_load_atomic(3)ck_pr_fence_load_store(3)ck_pr_fence_load_depends(3)ck_pr_fence_store(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/ π
okay that's the whole page, go forth and fence responsibly bestie π«Ά
and that's a wrap!! this one was dated April 7, 2013 and it's the ck_pr_fence_load(3) page, mwah, slay, bye π
β¨
π¦ where this page comes from
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian bookworm: libck-dev 0.7.1-10 Β· BSD-2-Clause
- 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
- epel 9: ck-devel 0.7.0-10.el9 Β· BSD
- 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 jammy: libck-dev 0.7.1-6ubuntu2 Β· BSD-2-Clause
- ubuntu noble: libck-dev 0.7.1-13build1 Β· 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