-
Notifications
You must be signed in to change notification settings - Fork 31
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
Added Paradict, a CTrie implementation #49
Conversation
This also adds a new dependency, Kcas |
Thanks for this PR @ElectreAAS! Paradict looks useful to have. A ctrie-based structure will offer very different performance characteristic and API than the hashmap that @lyrm is currently cooking (which is array+list based). Having said that, lockfree maps are hard to get right and we'll need a more exhaustive testing. Here's some thoughts: Parallel TestingThere's a few parallel tests for insertions, which are a good start, but at the minimum, we should have separate parallel tests for all core operations: insert, delete, find, update, snapshots and some combinations of them. Afterwards, we can take a look at the other functions that deal with entire data structure (e.g. size, iterators, ..), as I suspect they will either work on a snapshot or have a rather relaxed semantics. Inside the parallel tests, it's important to ensure there's a high chance of actual parallel execution. For example,
All of the above refer to hammering a single instance in different ways. A different approach taken by Carine in SPMC exposed yet new issues. OtherFurthermore, it would be nice to have dscheck tests and perhaps a rudimentary benchmark (how much are we actually faster than a locked map?). I'm happy to help if you have any questions. In particular, happy to take the dscheck part. A couple questions:
|
Related: ocaml-bench/sandmark#181 |
It is required for the functionality of the snapshot (as described in the follow-up paper by the authors), but not for the standalone data structure. I understood that the main draw of CTries was this snapshot operation so I suspect there might not be much interest in a CTrie without snapshot (and hence without KCas), but that's pure guesswork.
There can only be one |
For testing, I'm afraid I don't have any time to dedicate to that these days. Maybe next hacking days... I know that @OlivierNicole has done some hammering with qcheck & tsan, he might be able to give you some more info on that |
Yes, I have run a parallel property-based test using qcheck-stm, with ThreadSanitizer instrumentation to detect potential data races. There were no data races in the code (although my test covers only a subset of the Paradict API). |
Closing as stale. |
I added the library Paradict (from my repo).
The main code has been tested manually (but without dscheck yet) and seems pretty robust, but there may be a lack of documentation up to the standards of the project.
All file and variable names can be modified as my project wasn't done with the utmost professionalism in mind.
Feel free to suggest changes!