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+.
Is ck_hs_apply safe to use in the presence of another concurrent writer? Specifically, when an item is not being replaced or removed i.e. ck_hs_apply_fn_t returns the same pointer that was passed to it.
The reason I ask is I'm trying to figure out how to do reference counting on the items in the hash set, and need to avoid a race where an item is freed between ck_hs_get and a reference count increment:
Is
ck_hs_apply
safe to use in the presence of another concurrent writer? Specifically, when an item is not being replaced or removed i.e.ck_hs_apply_fn_t
returns the same pointer that was passed to it.The reason I ask is I'm trying to figure out how to do reference counting on the items in the hash set, and need to avoid a race where an item is freed between
ck_hs_get
and a reference count increment:Will
inc
be applied "atomically" beforeck_hs_remove
?