ck_ht_put_spmc (3) - Linux Man Pages
ck_ht_put_spmc: store unique key-value pair into hash table
NAMEck_ht_put_spmc - store unique key-value pair into hash table
LIBRARYConcurrency Kit (libck, -lck)
SYNOPSISIn ck_ht.h Ft bool Fn ck_ht_put_spmc ck_ht_t *ht ck_ht_hash_t h ck_ht_entry_t *entry
DESCRIPTIONThe Fn ck_ht_put_spmc function will store the key-value pair specified in the Fa entry argument in the hash table pointed to by the Fa ht argument. The key specified in Fa entry is expected to have the hash value specified by the Fa h argument.
If Fa ht was created with CK_HT_MODE_BYTESTRING then Fa entry must have been initialized with the ck_ht_entry_set3 function. If Fa ht was created with CK_HT_MODE_DIRECT then Fa entry must have been initialized with the ck_ht_entry_set_direct3 function.
It is expected that Fa h was initialized with ck_ht_hash3 if Fa ht was created with CK_HT_MODE_BYTESTRING. If Fa ht was initialized with CK_HT_MODE_DIRECT then it is expected that Fa h was initialized with the ck_ht_hash_direct3 function.
If the call to Fn ck_ht_put_spmc was successful then the key-value pair in Fa entry was successfully stored in the hash table pointed to by Fa ht and will fail if the key specified in Fa entry already exists with-in the hash table. Replacement semantics are provided by the ck_ht_set_spmc3 function.
RETURN VALUESUpon successful completion Fn ck_ht_put_spmc returns true and otherwise returns false on failure.
Behavior is undefined if Fa entry or Fa ht are uninitialized. The function will return false if the hash table required to be grown but failed while attempting to grow or if the key specified in Fa entry was already present in the hash table.
SEE ALSOck_ht_stat3, ck_ht_init3, ck_ht_destroy3, ck_ht_hash3, ck_ht_hash_direct3, ck_ht_set_spmc3, ck_ht_gc3, ck_ht_get_spmc3, ck_ht_grow_spmc3, ck_ht_remove_spmc3, ck_ht_reset_spmc3, ck_ht_reset_size_spmc3, ck_ht_count3, ck_ht_entry_empty3, ck_ht_entry_key_set3, ck_ht_entry_key_set_direct3, ck_ht_entry_key3, ck_ht_entry_key_length3, ck_ht_entry_value3, ck_ht_entry_set3, ck_ht_entry_set_direct3, ck_ht_entry_key_direct3, ck_ht_entry_value_direct3, ck_ht_iterator_init3, ck_ht_next3
Additional information available at http://concurrencykit.org/