You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to figure out from the documentation if SkipMap::compare_insert is atomic and didn't see anything explicitly mentioned. Based on a toy program that tries to use a SkipMap<&str, u64> as a set of atomic counters, it seems like it probably has the same semantics to get_or_insert_with and allows two concurrent callers to race. It'd be nice to reproduce that note on compare_insert (and maybe also get_or_insert) as well.
Happy to attach my toy program if it's useful. Thank you!
The text was updated successfully, but these errors were encountered:
SkipMap is the lock-free skip list, so it naturally allows two callers to race. It is atomic when actually replacing data(after I fixed it #1101), using compare_exchange. I will update the document. The implementation of compare_insert was done before I fixed the concurrency issues, which has led to some inaccuracies in the current documentation.
I was trying to figure out from the documentation if
SkipMap::compare_insert
is atomic and didn't see anything explicitly mentioned. Based on a toy program that tries to use aSkipMap<&str, u64>
as a set of atomic counters, it seems like it probably has the same semantics toget_or_insert_with
and allows two concurrent callers to race. It'd be nice to reproduce that note oncompare_insert
(and maybe alsoget_or_insert
) as well.Happy to attach my toy program if it's useful. Thank you!
The text was updated successfully, but these errors were encountered: