[Qgis-developer] comments on qgsvectorlayer.cpp
Martin Dobias
wonder.sk at gmail.com
Sat Sep 8 10:53:41 EDT 2007
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.
> 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.
Martin
More information about the Qgis-developer
mailing list