pythonqt icon indicating copy to clipboard operation
pythonqt copied to clipboard

class ‘PythonQtScriptingConsole’ doesn't work well after multithreading is enabled

Open dawnrs opened this issue 4 years ago • 1 comments

I found that when I enable multithreading support, I have to apply macro ‘PYTHONQT_GIL_SCOPE’ to the whole message loop to make class ‘PythonQtScriptingConsole’ work well. In general, this seems OK, but when I wanted to use macro 'PYTHONQT_ALLOW_THREADS_SCOPE' when the console was running, I found that I couldn't solve the problem. As you know, when macro 'PYTHONQT_GIL_SCOPE' exists, macro 'PYTHONQT_ALLOW_THREADS_SCOPE' is temporarily disabled. Therefore, when the class ‘PythonQtScriptingConsole’ does not execute any code at this time, the python thread created previously will not have a chance to be executed. So I think if class ‘PythonQtScriptingConsole’ can support multithreading, class ‘PythonQtScriptingConsole’ will be better.

dawnrs avatar Feb 26 '21 19:02 dawnrs

Have you solved the problem?

YuDe95 avatar Aug 11 '21 01:08 YuDe95