[Qgis-developer] comments on qgsvectorlayer.cpp

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Wed Sep 12 03:20:13 EDT 2007


On Saturday 08 September 2007 16:53:41 Martin Dobias wrote:
> On 8/31/07, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch> wrote:
> > > and it will need also some architecture changes -
> > > e.g. data providers do not provide thread-safe access, so concurrent
> > > reads from providers would end up with incorrect results.
> >
> > Wouldn't it be possible to have only one rendering thread so that thread
> > safe providers are not needed (at least as a first step)?
>
> I don´t think this is a good way. Let´s say that QGIS is rendering a
> map and in meanwhile user wants to open and browse attribute table -
> in this case we have a problem with concurrency, probably there are
> other situations that would need mutual exception.

Yes, those actions would be blocked during map rendering. But with the current 
solution, they cannot be used during map rendering as well.

> > But yes, on multiprocessor machines, it would be really cool to have
> > different threads rendering different tiles. Do you have an idea how
> > providers could be made thread safe?
>
> My idea is that we must provide an interface for iteration that
> wouldn´t have side effects on data provider. Members variables which
> are being modified during interation must be extracted from the
> provider and put to a specific subclass of an iterator. This way we
> can isolate different iterations at one time so threads won´t get into
> race condition.

Ok, seems like threaded rendering can only be done after another provider 
redesign. And there is also QgsRasterLayer which would need to be implemented 
in a thread safe way...

Regards,
Marco


-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee
marco.hugentobler at karto.baug.ethz.ch



More information about the Qgis-developer mailing list