Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linearizability of SkipMap/SkipSet #204

Closed
ghost opened this issue May 10, 2018 · 2 comments
Closed

Linearizability of SkipMap/SkipSet #204

ghost opened this issue May 10, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented May 10, 2018

SkipMap and SkipSet currently don't provide linearizability guarantees for their operations. Let's investigate if it is worthwhile inserting fences at the beginning/end of their methods to make everything linearizable.

The tradeoff is, of course, between performance and correctness (in the sense that bugs are less likely under stronger guarantees). In Rust we typically prefer to have strong guarantees by default with a possibility to opt-in into something faster with weaker guarantees (see HashMap vs FnvHashmap, sort vs sort_unstable, compare_exchange vs compare_exchange_weak, etc.).

See #6 for a previous discussion on the topic.

@ghost ghost transferred this issue from crossbeam-rs/crossbeam-skiplist Nov 5, 2018
@ghost
Copy link
Author

ghost commented Dec 6, 2018

Java's concurrent collections have pretty weak guarantees. The "Memory Consistency Properties" section here says:

Actions in a thread prior to placing an object into any concurrent collection happen-before actions subsequent to the access or removal of that element from the collection in another thread.

From that I would infer that ConcurrentSkipListMap's guarantees would be equivalent to what we call AcqRel orderings. If those guarantees have worked well for Java for more than a decade, they are probably good to copy.

cc @Amanieu

@ghost ghost closed this as completed Dec 6, 2018
@jeehoonkang
Copy link
Contributor

Sad that GitHub issue transfer doesn't fix issue number :-|

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant