-
Epic
-
Resolution: Unresolved
-
P3: Somewhat important
-
6.4
-
None
-
Qt for Python NoGIL
-
f489d5b90 (dev), ceb7567c7 (6.9), 7b8592161 (dev), 9d1124630 (dev), 481b48982 (dev), 559a0aa7b (dev), 8ea904ac0 (dev), 992093e0b (dev), 5738e06e7 (6.9), 39d406a96 (tqtc/lts-6.8), 2459c4c7d (dev), 65e8d9038 (dev), f0efc06db (dev), 04fc01fa4 (dev)
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
- 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
-
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 |
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 |
665334,33 | Introduce multi-phase Python extension module initialization | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
458708,3 | nogil: Apply the first necessary fixes | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
458908,2 | shiboken: Simplify sys module attribute lookup | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
458910,2 | nogil: Adjust the forgiveness enum opcode patch | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
459185,2 | NoGIL: Disable all tests which use refcounting | dev | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |
459188,4 | testing: make multiple_feature_test.py less verbose | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
459248,2 | NoGIL: Disable opcode tests in enum_test.py | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
459936,7 | WIP: NoGIL: Add mutex to protect Bucket | dev | pyside/pyside-setup | Status: ABANDONED | -2 | 0 |
459937,5 | NoGIL: Fix ~ObjectType() to handle children deleted before parents | dev | pyside/pyside-setup | Status: ABANDONED | +1 | 0 |
575418,49 | libpyside: Reimplement signal connections for Python callables not targeting a QMetaMethod | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
596712,2 | Fix disconnecting from C functions (qobject_connect_notify_test flakyness) | 6.8 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
596731,3 | Fix disconnecting from C functions (qobject_connect_notify_test flakyness) | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
638259,7 | WIP: disable-gil: Make the gilless option thread-safe | dev | pyside/pyside-setup | Status: ABANDONED | -2 | 0 |
638264,4 | PySide/Signal manager: Fix corruption when connecting to temporary object | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
640524,2 | PySide/Signal manager: Fix corruption when connecting to temporary object | 6.9 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
646660,2 | shiboken6/Bucket test: Use an atomic<bool> | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
646876,11 | testing: fix finding tests on new cmake versions | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
647383,4 | shiboken: fix windows glitch on limited-api=no | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
647442,1 | shiboken: fix windows glitch on limited-api=no | 6.9 | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |
647549,2 | testing: fix finding tests on new cmake versions | 6.9 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
656672,1 | Disable GIL state | dev | pyside/pyside-setup | Status: ABANDONED | +2 | 0 |
656789,3 | Output more detailed build in QLibraryInfo::build() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
657217,2 | Output more detailed build in QLibraryInfo::build() | 6.9 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
657234,3 | PySide6: Make qobjectNextAddr thread_local | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
657533,4 | build system: Extend sanitizer support | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
657957,8 | PySide6: Suppress warning when doing first signal connection from a thread | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
659580,2 | Disable GIL: Remove NoGIL code | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
659581,2 | Disable GIL: Basic adaption and compile fixes | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
660536,4 | Add developer documentation on thread sanitizer | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
663953,2 | Disable GIL: Remove NoGIL code | 6.9 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
664100,2 | Disable GIL: Remove NoGIL code | tqtc/lts-6.8 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |
665294,4 | libshiboken: Remove cast in Shiboken::Module::create() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
665333,2 | shiboken6: Factor out module initialization code | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
667662,23 | libshiboken: Split module initialization | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
667707,35 | shiboken6: Split init() function generation into separate functions | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
668111,10 | WIP: Split init function generation into exec()/init() | dev | pyside/pyside-setup | Status: ABANDONED | -2 | 0 |