3 ms·
Ideally a mutex is just a cmpxchg. It gets more expensive when it is contended. See the Drepper paper on futexes: http://www.akkadia.org/drepper/futex.pdf http
by revelation 9y ago
Ideally a mutex is just a cmpxchg. It gets more expensive when it is contended. See the Drepper paper on futexes:
http://www.akkadia.org/drepper/futex.pdf http://www.akkadia.org/drepper/futex.pdf
- mehrdadn 9y agoThanks, yeah, someone already mentioned this and I already edited in "contended" to clarify. I was actually already aware of futexes (thanks for the link though, I've never actually read the paper), but I was assuming contention -- the "every" referred to every type of operation, not every instance. See my reply to the sibling comment regarding lock contention.