CK_RHS_STAT(3)

πŸ’– ck_rhs_stat β€” bestie, let's get that hash set status πŸ’–

okay so this page lives in the CK_RHS_STAT(3) manual, and it's brought to you by the Concurrency Kit β€” that's libck, you link it with -lck. πŸŽ€


🌸 NAME 🌸

ck_rhs_stat β€” get hash set status. she's nosy, she wants the receipts, and honestly? valid. πŸ’…


πŸ“š LIBRARY πŸ“š

Concurrency Kit (that's libck, and yes you pass -lck when you're building). 🧚


✨ SYNOPSIS ✨

#include <ck_rhs.h>

void
ck_rhs_stat(ck_rhs_t *hs, struct ck_rhs_stat *st);

πŸ¦‹ DESCRIPTION πŸ¦‹

so ck_rhs_stat(3) is literally just a lil gossip session with your hash set. it takes all the juicy statistics and stores them in the object that st points at. no cap. 🫢

and the ck_rhs_stat structure is defined like this, exactly:

struct ck_rhs_stat {
        unsigned long n_entries;    /* Current number of keys in hash set. */
        unsigned int probe_maximum; /* Longest read-side probe sequence. */
};

so n_entries is how many keys are in the hash set right now β€” like, the current headcount. and probe_maximum is the longest read-side probe sequence, which is giving "how far did we have to dig to find someone" energy. iconic. πŸ‘‘


πŸŽ€ RETURN VALUES πŸŽ€

ck_rhs_stat(3) has no return value. void. nothing. she gives you stats and then she's gone, main character exit. πŸ’€


πŸ’€ ERRORS πŸ’€

okay bestie, listen up because this part is not a vibe:

  • behavior is undefined if hs is uninitialized. do not do that. do not pass me an uninitialized hash set. 😭
  • behavior is undefined if this function is called by a non-writer thread. like, writer threads only, periodt. don't be the friend who tries it from the wrong thread. πŸ™ˆ
fr fr, "undefined behavior" is not cute. it's the "we literally cannot tell you what happens" tier. respect the writer-thread rule. 🌈

πŸ‘‘ SEE ALSO πŸ‘‘

and if you want even more, the additional information is available at http://concurrencykit.org/ 🌐 β€” go read, it's giving ✨ research era ✨.


that's the whole page, babe. this one's dated September 17, 2012 and it's the CK_RHS_STAT(3) manual β€” mwah, sending you off with stats and good vibes only. πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from