3 ms·
Thanks, I used that neat knuth coin-flip trick from your code. Why does the comment on the file say that its lock-free implementation is half as slow as compar
by ignoramous 5y ago
Thanks, I used that neat knuth coin-flip trick from your code.
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?
- sadiq 5y agoSo that was in some quick benchmarks against the sequential one in the runtime: https://github.com/ocaml/ocaml/blob/trunk/runtime/skiplist.c https://github.com/ocaml/ocaml/blob/trunk/runtime/skiplist.c I haven't done a huge amount of investigation but I suspect the cost comes from the extra indirection in the lock-free one.