lock contention - what can we do about it?

David Nolden david.nolden.kdevelop at art-master.de
Sun Mar 6 11:32:05 UTC 2011


When doing "./duchainify --threads 10 -f all-declarations-and-uses
my-project --force-update" I get a CPU usage of about 90%, which shows
that I/O is probably the reason why you reach only low values.

That mutrace output does not really look useful. I just got an idea
how we can very simply fight the lock contention: Simply replace all
uses of QMutex with uses of SpinLock. For profiling, we can then
simply disable the QWaitCondition fallback in SpinLock, which means
that the lock will be doing an endless loop with 100% CPU
utilizitation while waiting. In turn, this means that we will see the
"waiting" time in the callgrind output, fairly compared to everything
else that is slowing down the application.

Greetings, David




More information about the KDevelop-devel mailing list