CK_EPOCH_BEGIN(3)

✨ CK_EPOCH_BEGIN(3) ✨

okay bestie, welcome to the ck_epoch_begin page from the Concurrency Kit manual, section 3 πŸ’– this one's a lil function that's basically the start of a glow-up arc for your epoch-protected code, and she's important, so let's get into it 🫢


🌸 NAME 🌸

ck_epoch_begin β€” begin an epoch-protected segment of execution πŸ‘‘

πŸ“š LIBRARY πŸ“š

Concurrency Kit (that's libck, link it with -lck bestie, don't forget) πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ck_epoch.h>

void
ck_epoch_begin(ck_epoch_record_t *record, ck_epoch_section_t *section);

πŸ’… DESCRIPTION πŸ’…

so the ck_epoch_begin(3) function literally marks the beginning of an epoch-protected code section ✨ it's giving opening credits. And what closes it? A call to the ck_epoch_end(3) function, periodt β€” those two are a duo, you don't get one without the other 🫢

now, here's the tea: recursion is allowed for epoch-protected sections, but β€” and this is the important part β€” recursive calls get associated with the ck_epoch_begin(3) that's sitting at the top of the call stack. Like, the main character is whoever's at the top, no cap πŸ‘‘

and if a section is passed? then recursion on a record will cause the epoch to be refreshed on entry of every protected section. every single one. she's thorough like that πŸ’…

πŸŽ€ RETURN VALUES πŸŽ€

this function has no return value β€” nothing, nada, she's a void, she simply doesn't do receipts πŸ’€

πŸ™ˆ ERRORS πŸ™ˆ

the object pointed to by epoch must have been previously initiated via ck_epoch_init(3) ⭐ and the object pointed to by record must have been previously registered via ck_epoch_register(3) 🌟

like, fr fr, do the setup first bestie. no skipping steps, that's the vibe check 😭

πŸ‘‘ SEE ALSO πŸ‘‘

and if you want even more, there's additional information available at http://concurrencykit.org/ 🌈 go be nosy, i support it πŸ’œ


that's the whole page bestie, you ate it πŸ’– this lil slice of the Concurrency Kit docs is dated September 2, 2012, and the manual name you'll see floating around in the header is CK_EPOCH_BEGIN(3) β€” mwah, iconic, no notes βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from