Open carsen-stringer opened 3 years ago
hey @sofroniewn or @tlambert03, can you share some insight here on how the plugin interface handles processing?
napari is still a single-threaded program. So yep, if you call a long-running function in the main thread, the GUI will freeze up. We haven't yet gone so far as forcing all plugin things to happen in a separate thread (since it is very tricky to do that in a thread-safe way, without knowing what the plugin developer is attempting to do, while still giving them access to events and objects in the main gui thread). So, for now, it's up to plugin developers to handle multi-threading themselves. however, we do have some tools to try to make this easier for people, specifically, see our thread_worker
decorators, described in our documentation on multithreading.
If I start a basic new window in pyqt and run something there it will cause the whole GUI to hang until it completes. Should plug-ins start separate python processes that run in the background or does napari have a way to handle this?