EasyScience / EasyDiffractionApp

Diffraction data analysis application
https://easydiffraction.org
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Replaced QThreads with python threads for macos #92

Closed rozyczko closed 3 years ago

rozyczko commented 3 years ago

This draft PR is for testing the installer on macos wrt. threading issues seen with QThreads.

NOT TO BE MERGED IN THE CURRENT STATE

AndrewSazonov commented 3 years ago

In the beginning, multithreading seems to work, but each subsequent fitting process takes longer and longer, even though the parameters to be fitted are exactly the same (this has never happened before). Also, the GUI stays responsive right after the fitting starts, but freezes after a few seconds, and this freeze time increases with each subsequent fitting run.

https://user-images.githubusercontent.com/20478229/119815194-91f0c700-beeb-11eb-909f-f3560a969359.mp4

rozyczko commented 3 years ago

Good! I expected some issues with thread close (which is what happens here) because I wasn't scrupulous with the thread lifetimes - just wanted to see if these solve the crashing issue. I'll add the proper thread handling between spawning.

rozyczko commented 3 years ago

I mistakenly assigned another/same slot to the finish signal, causing the post-fit update to be called increasingly more times. This was causing slow consecutive fits and GUI freeze

rozyczko commented 3 years ago

This is now ready to merge

We use standard python threads for fitting now, on all platforms. This is a temporary solution.