Hacker News new | past | comments | ask | show | jobs | submit login

Actually, the parking_lot mutex is fair: https://docs.rs/parking_lot/0.10.0/parking_lot/type.Mutex.ht...

The high waiting variance is because the benchmark randomly decides which locks to take, meaning that the amount of contention is variable.




Note that fair locking is still expensive. parking_lot achieves both speed and fairness by starting with unfair locking and falling back to fair locking.


Benchmark uses fixed seeds, there’s no inherent randomness.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: