Making Access to project configuration threadsafe

Matt Rogers mattr at kde.org
Wed May 30 14:08:26 UTC 2007


On Wednesday 30 May 2007 02:31, Andreas Pakulat wrote:
> 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

ah, ok. i misunderstood. We do need to make access to the project 
configuration threadsafe.
-- 
Matt




More information about the KDevelop-devel mailing list