1CK_HT_GET_SPMC(3) BSD Library Functions Manual CK_HT_GET_SPMC(3)
2
4 ck_ht_get_spmc — load a key-value pair from a hash table
5
7 Concurrency Kit (libck, -lck)
8
10 #include <ck_ht.h>
11
12 bool
13 ck_ht_get_spmc(ck_ht_t *ht, ck_ht_hash_t h, ck_ht_entry_t *entry);
14
16 The ck_ht_get_spmc() function will return the value associated with the
17 key specified in the entry argument in the hash table pointed to by the
18 ht argument. The key specified in entry is expected to have the hash
19 value specified by the h argument.
20
21 If ht was created with CK_HT_MODE_BYTESTRING then entry must have been
22 initialized with the ck_ht_entry_set_key(3) or ck_ht_entry_set(3) func‐
23 tions. If ht was created with CK_HT_MODE_DIRECT then entry must have been
24 initialized with the ck_ht_entry_key_set_direct(3) or
25 ck_ht_entry_set_direct(3) functions.
26
27 It is expected that h was initialized with ck_ht_hash(3) if ht was cre‐
28 ated with CK_HT_MODE_BYTESTRING. If ht was initialized with
29 CK_HT_MODE_DIRECT then it is expected that h was initialized with the
30 ck_ht_hash_direct(3) function.
31
32 If the call to ck_ht_get_spmc() was successful then the key-value pair in
33 entry was successfully found in the hash table pointed to by h and will
34 fail if the key specified in entry does not exist in the hash table. If
35 successful entry will contain the key-value pair found in the hash table
36 pointed to by the ht argument.
37
38 If ht was initialized with CK_HT_MODE_BYTESTRING then the key/value pair
39 in entry may be extracted using the ck_ht_entry_key(3) and
40 ck_ht_entry_value(3) functions. The length of the key may be extracted
41 using the ck_ht_entry_key_length(3) function.
42
43 If ht was initialized with CK_HT_MODE_DIRECT then the key/value pair in
44 entry may be extracted using the ck_ht_entry_key_direct(3) and
45 ck_ht_entry_value_direct(3) functions.
46
47 This function is safe to call in the presence of a concurrent writer.
48
50 Upon successful completion ck_ht_get_spmc() returns true. If successful,
51 entry will contain the key/value pair as found in the hash table. Other‐
52 wise the function returns false on failure.
53
55 Behavior is undefined if entry or ht are uninitialized. The function will
56 return false if the key as specified in entry was not found in the hash
57 table.
58
60 ck_ht_stat(3), ck_ht_init(3), ck_ht_destroy(3), ck_ht_hash(3),
61 ck_ht_hash_direct(3), ck_ht_set_spmc(3), ck_ht_put_spmc(3), ck_ht_gc(3),
62 ck_ht_grow_spmc(3), ck_ht_remove_spmc(3), ck_ht_reset_spmc(3),
63 ck_ht_reset_size_spmc(3), ck_ht_count(3), ck_ht_entry_empty(3),
64 ck_ht_entry_key_set(3), ck_ht_entry_key_set_direct(3),
65 ck_ht_entry_key(3), ck_ht_entry_key_length(3), ck_ht_entry_value(3),
66 ck_ht_entry_set(3), ck_ht_entry_set_direct(3), ck_ht_entry_key_direct(3),
67 ck_ht_entry_value_direct(3), ck_ht_iterator_init(3), ck_ht_next(3)
68
69 Additional information available at http://concurrencykit.org/
70
71 March 29, 2012