Making Access to project configuration threadsafe
Andreas Pakulat
apaku at gmx.de
Tue May 29 16:54:44 UTC 2007
Hi,
I'd like to ask our thread-experts for some ideas on how we could make
accesses to the project configuration threadsafe.
Currently the project configuration object can be obtained by
virtual KSharedConfig::Ptr projectConfiguration() const = 0;
which (afaik) isn't even safe to read from in multiple threads. We need
to stick with KConfig* or KSharedKConfig* (or ::Ptr) because there's
some logic involved when creating the KConfig object from our two
project config files.
One way I can see is having a static helper function that creates a
KConfig object from two given files which can be called from any thread.
The downside here is that plugins get access to either the (possibly
remote) project files or temporary copies of them and they can do
changes which would be overwritten on project closing. With a
KSharedConfig this doesn't happen.
Andreas
--
Your nature demands love and your happiness depends on it.
More information about the KDevelop-devel
mailing list