CK_RING_SIZE(3)

πŸ’– CK_RING_SIZE(3) β€” the "how many besties are in the queue rn" page πŸ’–

okay so this is a page from the Concurrency Kit manual, aka ck_ring_size(3), and it's lowkey the cutest little function ever. she counts things. that's the whole job. slay. πŸŽ€


🌸 NAME 🌸

ck_ring_size β€” returns the number of pointers currently enqueued in a bounded FIFO ✨

like. she looks at your ring buffer and goes "there are this many pointers in here bestie" and that's it. main character energy fr fr.


πŸ“š LIBRARY πŸ“š

Concurrency Kit β€” link it with libck, i.e. -lck. πŸ’œ


✨ SYNOPSIS ✨

#include <ck_ring.h>

unsigned int
ck_ring_size(ck_ring_t *ring);

she takes exactly one thing: a ck_ring_t * called ring. and she hands you back an unsigned int. no drama, no extra args, no notes. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

The ck_ring_size(3) function returns the number of pointers that are currently enqueued in the buffer pointed to by ring. 🫢

that's it. that's the function. it's giving "one job and she ate". the count is the pointers sitting in there right now, and the buffer in question is the one ring points at. πŸ‘‘

ngl, "currently" is doing a lot of heavy lifting there β€” this is a concurrency thing, so what's in the ring can change under you. that's just the vibe of the whole library, bestie. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

your girl does not exist in a vacuum, so go read her friends too:

and if you want even more lore, the website is right there: http://concurrencykit.org/ 🌈


okay that's the whole page!! this lil icon dropped on April 20, 2013, and it lives in the CK_RING_SIZE(3) section of the manual. mwah. no cap. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from