ck_ht_set_spmc(3) store key-value pair into hash table

LIBRARY

Concurrency Kit (libck, -lck)

SYNOPSIS

In ck_ht.h Ft bool Fn ck_ht_set_spmc ck_ht_t *ht ck_ht_hash_t h ck_ht_entry_t *entry

DESCRIPTION

The Fn ck_ht_set_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_set_spmc was successful then the key-value pair in Fa entry will contain the previous key-value pair associated with the key originally contained in the Fa entry argument. If the operation was unsuccessful then Fa entry is unmodified.

This function is safe to call in the presence of concurrent ck_ht_get_spmc operations.

RETURN VALUES

Upon successful completion Fn ck_ht_set_spmc returns true and otherwise returns false on failure.

ERRORS

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.