1. PyQt, IMHO, It looks as if you can just write it in Python and it will "just work" (with noted exceptions). However this is one of those exceptions that is not noted. Infact, it looks like it /should/ work. But it won't.
2. You are completely correct that his execution path is executing entirely in python and it is indeed the GIL.
 
The only way for him to accomplish this properly is to move the processing to C++ QObject (QRunnable?) and have C++ execute and manage it outside of Python entirely. Python would only tell the object to start it's thread. You'll also need to marshall the data from Python to Qt types, or have Qt directly manipulate the Python Objects.
 
 
 
 
Sent: Friday, December 06, 2019 at 1:28 PM
From: "Bob Hood" <bho...@comcast.net>
To: "Jason H" <jh...@gmx.com>, "Israel Brewster" <ijbrews...@alaska.edu>
Cc: "pyside@qt-project.org" <pyside@qt-project.org>
Subject: Re: [PySide] Keeping GUI responsive
On 12/6/2019 8:33 AM, Jason H wrote:
I can confirm your experience on Mojave.
 
If you increase your dataset 100-fold, then I get a beach ball. Based on what I am seeing here, QThread doesn't actually quite work.

Perhaps I'm misunderstanding what you're trying to achieve, but...

Python is not multi-threaded:  Never has been, and from what I can tell, never will be.  Qt isn't going to be able to magically change that.  A QThread is going to be blocked by the GIL if your execution path strays back into
any interpreted code.
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside

Reply via email to