Is it possible to run the App.main_loop() on a separate thread (not Pythons main_thread) (using the threading or asyncio module)? #1812
Replies: 2 comments
-
I haven't tested this, but... maybe. The interaction with the GUI framework on each platform is where things will get interesting. GUI frameworks are especially sensitive to which thread is the "main" thread; I think you might be safe as long as you create the thread you're going to use for the GUI before you do any GUI actions at all. Behavior across GUI frameworks will vary, so you'll need to test on all platforms you're intending to deploy to. Mobile platforms will be the greatest concern, as there is critical app logic in the bootstrap binary that will be very sensitive to being the "main" thread. Windows will also be an interesting case, due to the use of Single Thread Apartment mode. |
Beta Was this translation helpful? Give feedback.
-
Instead of running the |
Beta Was this translation helpful? Give feedback.
-
Is it possible to run the App.main_loop() on a separate thread (not Pythons main_thread) (using the threading or asyncio module)?
Beta Was this translation helpful? Give feedback.
All reactions