2 ms·
Locking a semaphore should be the same cost as accessing a (potentially cached) memory location. If you own the mutex and are unlocking it, then 25 ns sounds fi
by alain94040 17y ago
Locking a semaphore should be the same cost as accessing a (potentially cached) memory location. If you own the mutex and are unlocking it, then 25 ns sounds fine. If you are grabbing the lock from another cpu or core, then it will definitely be way more than that.
There would be some cache snooping to invalidate the other cpu's lock and gets your local version dirty.