CK_HT_REMOVE_SPMC(3)
π CK_HT_REMOVE_SPMC π
okay bestie, gather round, because we're looking at ck_ht_remove_spmc(3) from the Concurrency Kit manual β that's manual section 3, the "library functions" girlies. and per the NAME line, this one is officially here to "resize a hash table if necessary" β that's literally what it says up top, so we're reporting it as found, no notes π
β¨ LIBRARY β¨
she lives in Concurrency Kit, aka libck, and you link her with -lck. that's the whole vibe.
π SYNOPSIS π
#include <ck_ht.h>
bool
ck_ht_remove_spmc(ck_ht_t *ht, ck_ht_hash_t h, ck_ht_entry_t *entry);
look at her. three args, one bool return, zero drama.
π¦ DESCRIPTION π¦
so what does ck_ht_remove_spmc() actually do? she removes the key-value pair associated with the key that you specified with the entry argument. that's the whole assignment. bye bye entry π
now here's the part where you have to know which mode your table is in, because the rules are different depending on how ht was born:
- if
htwas created withCK_HT_MODE_BYTESTRING, thenentrymust have been initialized with theck_ht_entry_set_key(3)orck_ht_entry_set(3)functions. - if
htwas created withCK_HT_MODE_DIRECT, thenentrymust have been initialized with theck_ht_entry_key_set_direct(3)orck_ht_entry_set_direct(3)functions.
and same energy for the hash, bestie β it's an expectation, so don't be chaotic about it:
- it is expected that
hwas initialized withck_ht_hash(3)ifhtwas created withCK_HT_MODE_BYTESTRING. - if
htwas initialized withCK_HT_MODE_DIRECT, then it is expected thathwas initialized with theck_ht_hash_direct(3)function.
ngl, matching the wrong hash function to the wrong mode is giving "main character makes a mistake" energy, and not in a cute way. read your mode first, then hash. periodt.
πΈ RETURN VALUES πΈ
- if it worked?
entrywill contain the key-value pair that was found in the hash table, andck_ht_remove_spmc()will returntrue. we ate. π₯ - if the entry could not be found?
ck_ht_remove_spmc()will returnfalse. no pair, no vibes, justfalse. π
π SEE ALSO π
she does NOT work alone, she's part of a whole friend group:
ck_ht_stat(3)ck_ht_init(3)ck_ht_destroy(3)ck_ht_hash(3)ck_ht_hash_direct(3)ck_ht_set_spmc(3)ck_ht_put_spmc(3)ck_ht_gc(3)ck_ht_get_spmc(3)ck_ht_grow_spmc(3)ck_ht_reset_spmc(3)ck_ht_reset_size_spmc(3)ck_ht_count(3)ck_ht_entry_empty(3)ck_ht_entry_key_set(3)ck_ht_entry_key_set_direct(3)ck_ht_entry_key(3)ck_ht_entry_key_length(3)ck_ht_entry_value(3)ck_ht_entry_set(3)ck_ht_entry_set_direct(3)ck_ht_entry_key_direct(3)ck_ht_entry_value_direct(3)ck_ht_iterator_init(3)ck_ht_next(3)
additional information available at http://concurrencykit.org/ β go click, iykyk π
okay that's the page, bestie π«Ά this one was dated March 29, 2012, and the footer credits it as CK_HT_GROW_SPMC(3) β yes, the footer says grow while the top says remove, and we are simply not going to fight the manpage about it π anyway, mwah, go remove some entries responsibly β¨ππ¦
π¦ 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 2012-2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms