Details
-
Epic
-
Resolution: Unresolved
-
P3: Somewhat important
-
6.4
-
None
-
Qt for Python NoGIL
-
33bd61d13 (dev), c866be38d (dev), ab63b7fe0 (6.8), a4790d33c (dev), 72be78063 (6.9), d417218c4 (dev), a3d52a779 (dev), 03de46725 (dev), 5ee9a1f76 (6.9), f489d5b90 (dev), ceb7567c7 (6.9), 7b8592161 (dev), 9d1124630 (dev), 481b48982 (dev), 559a0aa7b (dev)
Description
Overview
Python 3.12 is probably starting to support a no-gil configuration. PySide should to find the necessary changes to enable that in the PySide project. The anticipated community reaction
is quite huge, since that will make Python really performant.
Currently, there is only a prototype implementation that we are using. It is based on Python nogil-3.9.10-1 with a register machine and different opcodes. This version is by no means the version expected for the fall, when Python 3.12 should come into existence with NoGIL.
It is not clear whether this branch will be continued at all. This depends very much
on business decisions. I just wanted to make sure of the feasibility, but I'm not implementing it yet.
The feasibility is definitely there if they have the right people and time.
Areas in need of thread protection
(to be identified by thread sanitizer).
libshiboken/ Object deletion
- https://codereview.qt-project.org/c/pyside/pyside-setup/+/660549
- Potentially many areas in Object deletion (reuse wrapper map lock?)
- libshiboken setParent()/ removeParent() and destruction maintaining lists of children and pointer to parent in SbkObjectPrivate/ParentInfo
The question is whether one mutex should be used for all this (sort of GIL replacement), Potential candidate
is the existing wrapper mapper lock.
Signal/Slot connections
- https://codereview.qt-project.org/c/pyside/pyside-setup/+/657290/5
- https://codereview.qt-project.org/c/pyside/pyside-setup/+/660548
- (pending) Signal/Slot ConnectionHash in sources/pyside6/libpyside/dynamicslot.cpp:303
- (pending) updateSourceObject() as called by QObject._init_() sources/pyside6/libpyside/pysidesignal.cpp:941 (reported by sanitizer)
- signalInstanceDisconnect sources/pyside6/libpyside/pysidesignal.cpp:719 (reported by sanitizer)
- disconnect_notify
The question is whether one mutex should be used for all of the signal code and the locked areas be extended?
Override handling
- Sbk_GetPyOverride, Spurious evidence so far.
Done
- setNextQObjectMemoryAddr() sources/pyside6/libpysideqml/pysideqmlregistertype.cpp:41 (thread_local?)
- basic compile fixes, removed NoGIL code
References
Attachments
Issue Links
- is duplicated by
-
PYSIDE-2776 Free-threaded CPython and PySide
-
- Closed
-
- relates to
-
PYSIDE-1819 PySide GIL locking semantics are undocumented creating deadlock potential
-
- Open
-
-
PYSIDE-1931 Pyside2 app hangs in QSqlQueryModel.setQuery() connecting to database over paramiko/sshtunnel (PostGres)
-
- Closed
-
Gerrit Reviews
For Gerrit Dashboard: PYSIDE-2221 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
459935,27 | WIP: Disable GIL: Implement free threading for Python 3.13 | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |
652346,15 | handover: Save status information of unfinished work | dev | pyside/pyside-setup | Status: NEW | -1 | 0 |
657290,5 | WIP: Disable GIL/PySide6: Protect the signal connection hash by a mutex | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |
657957,5 | WIP: PySide6: Suppress warning when doing first signal connection from a thread | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |
660536,2 | Add developer documentation on thread sanitizer | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
660548,1 | WIP: Disable GIL: Lock updateSourceObject() | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |
660549,1 | WIP: Disable GIL: Lock SbkDeallocWrapper | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |
660550,1 | Disable GIL: Add stress test | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
660551,1 | WIP: Disable GIL: Remainder | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |