For reference this is a concurrent skip list that a high school student could implement. It's beautiful.
https://people.csail.mit.edu/shanir/publications/LazySkipLis...
For reference this is a concurrent skip list that a high school student could implement. It's beautiful.
https://people.csail.mit.edu/shanir/publications/LazySkipLis...
It's used to manage code fragments that need to be accessed in signal handlers.
Why does the comment on the file say that its lock-free implementation is half as slow as compared to 'sequential' one? Where does the slowness come from? Is it all those while(1) loops waiting to race atomic operations?
I haven't done a huge amount of investigation but I suspect the cost comes from the extra indirection in the lock-free one.
I agree it's a beautiful data structure, but this imagined high school student would be one who is comfortable with (learning about) pointers and locks. Those exist of course, in fact we probably both qualified back in the day.
My point however is that that implies some major selection bias towards high school students who love programming for programming's sake, not some average high-school student who learned a bit of Python and JavaScript in their introduction to computer science class or because they want to write a game (which is a totally valid reason to learn programming). I don't really see why B-trees as a data structure would be that much more difficult to grok if we're already talking about that type of student?