Thread-safety issue in cmake support ?

Christoph Cullmann cullmann at absint.de
Wed Jun 9 06:43:39 UTC 2010


On Wednesday 09 June 2010 08:35:51 Andreas Pakulat wrote:
> > > 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.
> 
> This already doesn't work, as its being done in a background thread
> (with the current framework) and hence any time the same configuration
> object may be accessed from the foreground thread.
;) I know it doesn't work that way in kdevelop, I just tell, how it can work and how it is done in many applications. (we do it in our company that way to, for our parsing in the static analyzer gui we build)

Such work to start threads must be done in main thread, then be dispatched (and users won't really feel it, we speak about little data to collect blocking)
QtCreator does it that way (As they, like any other IDE, must live with not-threadsafe toolkits).
But yeah, I think it might be unrealistic, that it can be implemented in time in kdevelop, I already told that concerns the poor people at the kdevelop/kate sprint, that most of kdevelop works just by chance, as there is no way to lock everything correct, the way it is done atm.

And yeah, perhaps the BKL is the only way to solve it, but I am with you, that this will kill most benefits of multi-threading.

Greetings
Christoph

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




More information about the KDevelop-devel mailing list