Re: [Twisted-Python] Re: Twisted and the Posh Module
Ah, so *that* is why the SANE GUI frontend I'm writing [1] pauses scanning and window events when it's using PIL to generate a thumbnail of the last page scanned, despite my use of deferToThread. A unit test I wrote with time.sleep() passed just fine, and I threw my hands up and walked away. Thanks for shedding light on what was very confusing and frustrating behavior. [1] spdf: "Scan to PDF," GPL. A Twisted-driven application with, shockingly, absolutely no networking. Coming soon to a download URL near you... --- Ed Suominen Registered Patent Agent Open-Source Software Author (yes, both...) Web Site: http://www.eepatents.com On Monday 14 March 2005 02:11 pm, twisted-python-request@twistedmatrix.com wrote:
My goal is somewhat similar in that I have multiple CPU's that aren't being used very much, but the other problem is that certain libraries I use (PIL) grab the GIL for long-running operations like image modifications. I can thread them off, but it still liberally acquires the GIL and makes the server unresponsive for the duration of the operation.
On Mon, 2005-03-14 at 14:27 -0800, Ed Suominen wrote:
Ah, so *that* is why the SANE GUI frontend I'm writing [1] pauses scanning and window events when it's using PIL to generate a thumbnail of the last page scanned, despite my use of deferToThread.
Arguably not releasing the GIL in C code is a bug, and someone should probably report it.
Itamar Shtull-Trauring wrote:
On Mon, 2005-03-14 at 14:27 -0800, Ed Suominen wrote:
Ah, so *that* is why the SANE GUI frontend I'm writing [1] pauses scanning and window events when it's using PIL to generate a thumbnail of the last page scanned, despite my use of deferToThread.
Arguably not releasing the GIL in C code is a bug, and someone should probably report it.
They are aware of it, and in the alpha version of PIL, *some* operations no longer acquire the GIL, but many still do. -Ken
Ken Kinder <ken@kenkinder.com> writes:
Itamar Shtull-Trauring wrote:
On Mon, 2005-03-14 at 14:27 -0800, Ed Suominen wrote:
Ah, so *that* is why the SANE GUI frontend I'm writing [1] pauses scanning and window events when it's using PIL to generate a thumbnail of the last page scanned, despite my use of deferToThread.
Arguably not releasing the GIL in C code is a bug, and someone should probably report it.
They are aware of it, and in the alpha version of PIL, *some* operations no longer acquire the GIL, but many still do.
Well, err, "some operations no longer acquire the GIL" reads slightly backwards to me; "some operations now release the GIL" seems fairer -- PIL is only thwarting you passively, not actively :) Cheers, mwh -- Enlightenment is probably antithetical to impatience. -- Erik Naggum, comp.lang.lisp
participants (4)
-
Ed Suominen
-
Itamar Shtull-Trauring
-
Ken Kinder
-
Michael Hudson