concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.
http://concurrencykit.org/
Other
2.35k stars 312 forks source link

add `ck_hs_try_put` function. #106

Closed aidancully closed 6 years ago

aidancully commented 6 years ago

ck_hs_try_put is like ck_hs_put, except that it returns the old value from the hash-set if it exists.

aidancully commented 6 years ago

I note that ck_hs_apply can be used to similar effect... I think this function is easier to work with, since it allows clients to avoid defining a callback.

sbahra commented 6 years ago

Thanks for this! I'll review it later this week over Thanksgiving.

sbahra commented 6 years ago

After discussion, folks decided to go with using ck_hs_apply instead.