[Qgis-developer] [Qgis-user] Problem with "add postgis layers" in qgis 1.80

Etienne Tourigny etourigny.dev at gmail.com
Thu Jul 19 15:16:03 PDT 2012


Hi,

On Thu, Jul 19, 2012 at 5:45 PM, Jürgen E. <jef at norbit.de> wrote:
> Hi Etienne,
>
> On Thu, 19. Jul 2012 at 15:17:42 -0300, Etienne Tourigny wrote:
>> A more generic question - is there a way that we could implement a
>> generic mechanism for stopping a processing that takes forever, such
>> as
>>
>> - Identify tool in a *very* large vector layer
>> - unresponsive WMS server (when opened in the browser dock)
>
>> I would like to be able to be able to cancel such actions, for example
>> wit the Esc key. Currently when this happens I have to kill the qgis
>> application which is rather extreme.
>
>> Would this require running processes in a thread, or is there a way QT
>> can listen for a specific event and cancel whatever is happening,
>> returning to a "inactive" application?
>
> Threads can help, if you can't avoid to block, but other things can be solved
> by switching from iterative processing to event driven processing (with or
> without threads).
>
> That's the "normal" way Qt does things, but as soon we leave the framework and
> turn to external APIs like GEOS, GDAL, libpq etc. the intended (or just the
> easiest) way there is iterative.  And therefore lots of stuff in QGIS is also
> iteratively.  There are even a few places where event driven Qt stuff is
> wrapped in a polling loop with QCoreApplication::processEvents(), when we need
> event driven Qt stuff within iterative loops.
>
> Although we could probably move all that blocking stuff into threads, that emit
> signals whenever a blocking iterative loop within the thread continues.
>
> So curring this would require major changes - also to the QGIS API. Add
> complexity and also introduce new pitfalls (eg. race conditions, locking...).
>

I guess then the pragmatic way to resolve these kinds of issues is to
spawn them in working threads and implement mechanisms for cancelling
it.
Is this possible with the current api?

For example - could the browser dock run in a separate thread? That
way, if it becomes unresponsive at least the app isn't.

> BTW the threading branch was/is addressing some of these issues.

Are you referring to the inactive dev-threading branch? Any plans on
reviving that? I think there was a discussion about that a short while
ago.

>
>
> Jürgen
>
> --
> Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-31
> Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
> Software Engineer         D-26506 Norden               http://www.norbit.de
> committ(ed|ing) to Quantum GIS                         IRC: jef on FreeNode
>
> --
> norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
> Rheinstrasse 13, 26506 Norden
> GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list