Em quarta-feira, 1 de mar?o de 2017, ?s 17:40:04 PST, Daniel Mihai escreveu: > Did you find a good description of askldjd's benchmark/test? Without that, > it?s hard to say what their graph is depicting. > > I explained below how the traditional Windows locks keep track of > RecursionCount. It seems super-cheap/non-measurable to me.
Looks like the test was trying to run 2 million lock/unlock cycles with a number of mutexes. It isn't clear whether the mutexes are contended or not. I think the test shows a null result: it's a microbenchmark, so of course that the the minor difference in work will show up. That is particularly true if your mutex implementation is well-optimised so that it doesn't actually take much CPU. You have to measure the impact versus the other work that is expected to happen. And even then, I dispute the results. If those mutexes are independent from one another, adding a new mutex shouldn't make the older one slower (unless the implementation suffers from false sharing). -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
