Priority: Not Evaluated
Resolution: Won't Do
Affects Version/s: 5.15.2, 6.2.2
Fix Version/s: None
Hello, I'm facing a probleme related to 1176 and 803
the overriden methods of my widgets are calling the super-class methods, but those do not allow threads despite being in native C++. Thus my background tasks as completely slowed down each time the native method is slow (performing rendering for instance).
What I'm doing is quite simple, working on a 3D view I have a widget doing rendering and navigation.
Here is my initial implementation (which works well for everything but multithreading)
This works great until we need a thread performing anything frequently (either computations, but io tasks as well !) In my specific case, the background task is a socket communication
my background thread has a loop that loops:
- every 0.05s as planned when no Qt app is running
- every 0.05s as planned when a Qt app is running with the SceneView idling
- every 1s due to Qt slowing down, when the SceneView is frequently updated (a mouse movement for instance)
So I agree, with the conclusion of 803 that most method should no release the GIL to keep up the GUI's performances, but the methods that are going to run for a while definitely (in my case, QOpenGLWidget.event should)
Here is the complete implementation of the widget: pymadcad/rendering
There is a workaround for my specific case: having a different widget for receiving the events than for rendering. So we will not override the event method responsible for rendering.
However this is more a trick than a solution: I'm obliged to create an invisible widget just to deal with event dispatching behaviors. Also It won't solve an issue with a slow method doing something else than rendering ...
I noticed there is the same issue with PyQt5 5.15
Could it be possible that in next versions of PySide, QOpenGLWidget.event and eventually QWidget.event would release the GIL ?