You are not logged in.
Pages: 1
This post may be interesting: https://justine.lol/mutex/
It is based on https://github.com/google/nsync
Last edited by okoba (2024-10-03 07:58:48)
Offline
The problem with such claims is that the benchmark involved for measurement is really an unrealistic micro-benchmark.
Noone would use a mutex to incremenent an integer: we would all use an atomic increment instruction.
So what is measured here is the contention itself: when several threads try to acquire the lock.
In normal code, it should not appear often. Or you are locking too much content, or for too much time, or too often.
Most of the time, in real world, a well-defined mutex won't have contention: and all implementations rely on a CAS operation for this most simple case.
This is why we have several locks in mORMot.
https://blog.synopse.info/?post/2022/01 … e-Them-All
Offline
Pages: 1