[Qgis-developer] Fwd: Threads in sextante

Martin Dobias wonder.sk at gmail.com
Tue May 29 10:27:02 PDT 2012

On Tue, May 29, 2012 at 12:02 PM, Victor Olaya <volayaf at gmail.com> wrote:
> The iterating execution could be run in paralell, asumming that
> several threads can open the same layer at the same time. the layer to
> be iterated is converted in n layers, each on containing just one
> feature, but if the algorithm uses other layers, they are used all the
> same for all the executions. I guess that opening some kind of formats
> might block the file, which might cause other threads to fail.
> Unless we are completely sure that all file formats (or data sources,
> more generally speaking) can be accesed simultaneously and
> independently by several threads (which I am no sure, and I think that
> might not be like that), it is better to execute the processes on
> after the other, just like calling several algorithms as it happens in
> the modeler or the batch processing interface.


in QGIS the layer data can be accessed just from one thread at the
same time. This is limitation of either QGIS and its underlying
libraries (GDAL/OGR).  When running algorithm without blocking GUI, it
would be good to always open a new instance of QgsMapLayer to make
sure that user's interaction with GUI will not break the access to
data (e.g. simple pan/zoom operation while an algorithm is reading
data from the same QgsMapLayer instance will cause problems).


More information about the Qgis-developer mailing list