You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when the Stop button is pushed, the calibration and deconvolution computation processes continue to run on the CPU/GPU. This is evident by the output in the terminal window.
If the user does not put any yields in their function, and the function is super long, it will just hang… For instance, there’s no graceful way to kill this thread in python:
This is why it’s always advisable to use a generator that periodically yields for long-running computations in another thread.
See this stack-overflow post for a good discussion on the difficulty of killing a rogue python thread:
Talley Lambert:
yep! That’s correct. You don’t even need to actually “yield” something either. just need to sprinkle them in there. This is >obviously easiest if your long-running function already iterates somehow. But, it can be tricky in certain cases.
@thread_worker
def long_runner():
for _ range(whetever):
...
yield
Description
Currently, when the Stop button is pushed, the calibration and deconvolution computation processes continue to run on the CPU/GPU. This is evident by the output in the terminal window.
Files
napari-LF/src/napari_lf/_widgetLF.py
Lines 169 to 172 in 76f7d2a
Solution ideas
Try to fix once https://github.com/PolarizedLightFieldMicroscopy/LFAnalyze-fundamentals/issues/7 is fixed. The line
self.thread_worker.quit()
should stop the computations.The text was updated successfully, but these errors were encountered: