Crates.io | nerdondon-hopscotch |
lib.rs | nerdondon-hopscotch |
version | 2.7.0 |
source | src |
created_at | 2021-09-20 08:04:54.400415 |
updated_at | 2022-10-19 08:10:14.72002 |
description | A skip list |
homepage | |
repository | https://github.com/nerdondon/hopscotch |
max_upload_size | |
id | 453874 |
size | 104,185 |
What it says. Cuz it skips.
Note this is a toy project and is not meant for production usage...yet(?). It's primary purpose will be as part of a database internals teaching project.
The implementation of the algorithms in v1 adheres somewhat faithfully to the algorithms as laid out in the original paper by Pugh.
Uses a geometric distribution for determining if a new key is part of a level (fancy for saying we flip a coin). The geometric distrubution actually defaults to p = 0.25 but this is configurable.
NOTE: There may be a measure of undefined behavior here (sounds bad I know). Don't use this unless you really want to try some crazy hack I did.
A version of the skip list that allows for lock-free concurrent reads is now available by turning on
the concurrent
feature. This skip list has a couple major feature gaps:
Callers must get a lock (e.g. Mutex
or RwLock
) over the skip list before insertions can be
done.
Delete has not been implemented yet because my use case does not require delete.
Work is planned to follow this up with a proper implementation of a fully concurrent and almost-lock-free skip list.