CK_EPOCH_RECLAIM(3)
π CK_EPOCH_RECLAIM(3) β bestie edition π
okay so this is the manual page for ck_epoch_reclaim(3), part of Concurrency Kit (aka libck, link it with -lck) π
β¨ NAME β¨
ck_epoch_reclaim β immediately execute all deferred callbacks π«Ά
like, right now. no waiting. no vibes-based delay. just do them.
π LIBRARY π
Concurrency Kit (libck, -lck) π
πΈ SYNOPSIS πΈ
#include <ck_epoch.h>
void
ck_epoch_reclaim(ck_epoch_record_t *record);
π DESCRIPTION π
so the ck_epoch_reclaim(3) function will unconditionally execute all callbacks that have been deferred with ck_epoch_call(3) β¨
that's it. that's the whole function. she does not ask questions, she does not check the vibes, she does not wait for the grace period to be over on her own β she just runs every single deferred callback you handed her. periodt π
ngl bestie, "unconditionally" is doing a lot of heavy lifting in that sentence. she runs them because you said so, not because it was safe. iykyk π
π¦ EXAMPLE π¦
#include <ck_epoch.h>
#include <ck_stack.h>
#include <stdlib.h>
/*
* epoch was previously initialized with ck_epoch_init.
*/
ck_epoch_t *epoch;
void
function(void)
{
ck_epoch_record_t *record;
logically_delete(object);
ck_epoch_call(epoch, record, &object->epoch_entry, destructor);
/*
* Wait until no threads could possibly have a reference to the
* object we just deleted.
*/
ck_epoch_synchronize(epoch, record);
/*
* Execute all deferred callbacks.
*/
ck_epoch_reclaim(record);
return;
}
see how she goes? logically delete the object πΈ, defer the real cleanup with ck_epoch_call(3) π, synchronize so nobody could possibly still be holding a reference π, and then β only then β ck_epoch_reclaim(record) to actually run every deferred callback. the way that order mattersβ¦ iconic. π₯
β RETURN VALUES β
this function has no return value. she gives you nothing back and honestly? she doesn't have to. π«Ά
π SEE ALSO π
ck_epoch_init(3)ck_epoch_register(3)ck_epoch_unregister(3)ck_epoch_recycle(3)ck_epoch_poll(3)ck_epoch_reclaim(3)ck_epoch_barrier(3)ck_epoch_call(3)ck_epoch_begin(3)ck_epoch_end(3)
more lore available at http://concurrencykit.org/ π§
Concurrency Kit, May 2, 2013 β that's the source/version and the date this page was born, and that's a wrap bestie π go execute those callbacks (safely, please) πβ¨π
π¦ 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