Making Access to project configuration threadsafe

Andreas Pakulat apaku at gmx.de
Wed May 30 07:31:09 UTC 2007


On 30.05.07 00:01:20, Matt Rogers wrote:
> On Tuesday 29 May 2007 11:54, Andreas Pakulat wrote:
> > 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.
> 
> Is it possible for us to move on to other things instead of dwelling on 
> something that already works, although it's a bit slow? Speeding up the 
> project parsing is a noble goal to have. However, I think our efforts are 
> best focused on making other things work and then go back to make other 
> things work better. 

This is not about project opening beeing threadded, my request is to
make access to the project configuration thread safe. Which is pretty
important as this might happen in various parts of KDevelop (getting the
project config in a different thread).

I personally don't care too much for project opening time, its a few
seconds at the moment for the projects I open (including kdevelop).

Andreas

-- 
Be security conscious -- National defense is at stake.




More information about the KDevelop-devel mailing list