Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-931

Option to control GIL-code-handling in shiboken2

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.2
    • 5.12.1
    • Shiboken
    • None
    •  

    • All
    • 099f3f46ca9ec1362f211278df4b3e4949b0a339 (pyside/pyside-setup/5.12)

    Description

      There should be an option to have shiboken2 not deal with the GIL in generated code per default. This could be enabled on the command line of shiboken2 or via the typesystem.xml. Scope should be global or at least per type (class).

      It's all about code generated like this (for most, if not all, methods): 

      PyThreadState* _save = PyEval_SaveThread(); // Py_BEGIN_ALLOW_THREADS
      // ...my code here...
      PyEval_RestoreThread( _save ); // Py_END_ALLOW_THREADS
      

      I don't want shiboken2 to do those PyEval_SaveThread()- / PyEval_RestoreThread( _save )-calls. Reason: I don't want shiboken2 to make assumptions about the code the user may add there. In my case, for instance, I really need to hold the GIL there in many cases.

      I've read about the "modify-function" node along with "allow-thread" here: modify-function. This is nice but would require me to apply it to each and every method (I've really a lot of those )
       

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-931
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              thebrave71 David Venditti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: