News for hackers. Stuff that matters.
Re:New Concurrent Hash Maps for C++ by gpderetta on Tuesday February 02, 2016 @07:54PM (#11023988)
OK, now I see what you are saying. It would certainly be true for a spin lock, but it seems to me that, for std::mutex, the kernel transition required to arbitrate contention would dominate even on the coherency traffic, right?
Re:New Concurrent Hash Maps for C++ by vardump on Wednesday February 03, 2016 @12:07AM (#11024822)
Yeah, I was talking about spinlocks.

You're right that context switches would dominate std::mutex. For some reason I was thinking std::mutex uses spinlocks, even though I knew better. Too much kernel side coding lately - context switches are often not possible there, so mutexes are often not possible as potential synchronization mechanisms.

Re:New Concurrent Hash Maps for C++ by gpderetta on Friday February 05, 2016 @12:56PM (#11043221)
You might still be right. The implementation of std::mutex is unspecified, and real world implementations will probably spin a bit before going into the kernel, so for your test case with a tiny critical section it might behave like a spinlock.