Thread-safety issue in cmake support ?

Christoph Cullmann cullmann at
Tue Jun 8 05:43:10 UTC 2010

On Monday 07 June 2010 19:40:37 Milian Wolff wrote:
> > Like the name, the BKL (either big kernel or big kdevelop lock), you will
> > get lock contention really fast I guess, didn't you already some profiling
> > work, showing that atm the lock contention is high?
> > 
> > I don't know any solution for the locking problems beside the bkl, too, as
> > kdevelop just intermixes to much stuff without locking and with the gui,
> > but keep in mind: each event, each mouse move, anything will trigger the
> > locking of this lock and compete with all your background threads, which
> > compete with each other then, too.
> True, it's a sad world we live in :)
> If someone has a better idea, I'm all for it though :-) Until then, it's 
> probably the only thing we can do.
The right solution (TM) is simple:
You must first pack all stuff needed for your thread into a local copy, then start it working only on that copy of the data and only do feedback via a well defined interface, for example some queued signals at the very end.
For the KConfig case, that means collecting the needed config values once before the parsing thread does its work. It makes no sense to allow changing config while it is running anyway, then
you can abort and restart the parsing in any case.
For the kate part case that means, getting text and revision number, doing all parsing on the copy and create dumb ranges in the thread, after done, creating + translating the moving ranges in the main thread.

> There are sadly too many tools out there which we must use that do not work in 
> a multi threaded environment...
It's not sad, it is just not possible to make any data structure thread safe and it is not advicable, too. 
It normally (beside very well designed lock-less datastructures) means spreading in locks everywhere, which just kills any benefit of the multi-threading if you access them random.


-------------------------------------- Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann at
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234

More information about the KDevelop-devel mailing list