MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / insert

Method insert

tests/relacy/spmchash.cpp:43–48  ·  view source on GitHub ↗

Not thread safe. Only call from single producer thread. Note: key must *not* be in hash already, and must be exactly one larger than the previously inserted key value.

Source from the content-addressed store, hash-verified

41 // Note: key must *not* be in hash already, and must be exactly
42 // one larger than the previously inserted key value.
43 void insert(std::uint64_t key, TValue* value)
44 {
45 IndexEntry* idxEntry;
46 insert_index_entry(idxEntry, key);
47 idxEntry->value.store(value, std::memory_order_release);
48 }
49
50 // Thread-safe, but if somebody can remove the key while find() is
51 // in progress, then any returned value is not guaranteed to correspond

Callers 2

threadMethod · 0.45
core_spmc_hashMethod · 0.45

Calls 1

storeMethod · 0.45

Tested by 1

core_spmc_hashMethod · 0.36