[Qgis-developer] Multithread rendering with GRASS vectors crash

Martin Dobias wonder.sk at gmail.com
Sun Apr 27 04:14:03 PDT 2014


On Wed, Apr 23, 2014 at 3:41 PM, Radim Blazek <radim.blazek at gmail.com> wrote:
> Multithread rendering crashes if multiple GRASS vector layers from the
> same map are rendered simultaneously. It is mentioned in #9980.
>
> That happens because to save resources, the GRASS vector provider
> keeps only single instance of each opened vector map in static
> QgsGrassProvider::mMaps. I am not sure if the crash comes from GRASS
> lib or from the provider. Parallel rendering of layers from different
> maps works OK. It means that only one layer from a map may be rendered
> at time but parallel rendering of multiple layers from different maps
> is desired.

Actually it was a broader problem with any GRASS maps, I have found
out that GRASS library is not reentrant and simply cannot be used from
multiple threads.


> What can be done Martin? Some conditional mutex? Can you fix that?

Yes, a mutex should work - should be fixed in 40b20f. As a result, all
access to GRASS from iterators is serialized.

Cheers
Martin


More information about the Qgis-developer mailing list