CK_PR_LOAD(3)
π ck_pr_load(3) β the manual page, but make it cute π
okay bestie, gather round π«Ά this is ck_pr_load(3) from the Concurrency Kit library β the one that's basically the "grab me that value, and do it safely" family of functions. Nine little legends. Let's go. β¨
πΈ LIBRARY πΈ
Concurrency Kit (that's libck, link it with -lck) β yeah, that's the one. π
β¨ SYNOPSIS β¨
#include <ck_pr.h>
void *
ck_pr_load_ptr(const void *target);
double
ck_pr_load_double(const double *target);
unsigned int
ck_pr_load_uint(const unsigned int *target);
int
ck_pr_load_int(const int *target);
char
ck_pr_load_char(const char *target);
uint64_t
ck_pr_load_64(const uint64_t *target);
uint32_t
ck_pr_load_32(const uint32_t *target);
uint16_t
ck_pr_load_16(const uint16_t *target);
uint8_t
ck_pr_load_8(const uint8_t *target);
nine functions, nine vibes, one header, zero excuses π§
π« DESCRIPTION π«
So here's the tea, bestie. β The whole ck_pr_load(3) squad does one thing and does it flawlessly: it atomically loads the value that target is pointing at, and hands it right back to you. Like, you ask for the value, the value shows up, no drama, no weird in-between states, no "wait was that the old value or the new one". π
And here's the part that makes it actually iconic β every single one of these functions always serves as an implicit compiler barrier, and it is not susceptible to re-ordering by the compiler. Not me letting the compiler shuffle my loads around... couldn't be these functions. π€ The compiler is gonna respect the order of operations, periodt. π
π RETURN VALUES π
Every function in this family returns the value contained in the location pointed to by the first argument. That's it. That's the whole reveal. You point at a thing, you get the thing. π
π¦ SEE ALSO π¦
the whole extended friend group, fr fr π
ck_pr_fence_load(3)ck_pr_fence_load_depends(3)ck_pr_fence_store(3)ck_pr_fence_memory(3)ck_pr_add(3)ck_pr_store(3)ck_pr_fas(3)ck_pr_faa(3)ck_pr_inc(3)ck_pr_dec(3)ck_pr_neg(3)ck_pr_not(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)
And if you want even more lore, additional information is available at http://concurrencykit.org/ π β go read, bestie, it's giving documentation main character energy. πβ¨
okay that's the whole page, you understood all of it, I'm so proud of you π
signing off from the very bottom of the page: this was ck_pr_load(3), dated April 15, 2013 π β yes she's an elder but she still slays, and she comes to you courtesy of Concurrency Kit. take care of her, she's atomic. π π«ΆπΈ
π¦ 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