We’ve had preemptive threads for a hot minute at this point. I wanted to check in and see how people are using them, and how the results are looking - are they worth the effort for your use case? What works? What’s a challenge?
They work fine. But for me they crash when they are finished. I wasn’t able to reproduce or have a workaround so I gave up on the preemptive threads.
I started using one some months ago; it allows me to load middle-large sound files asynchronously without the whole app hanging.
As this required a lot of refactoring, since obviously the whole project started without those preemptive threads, it’s true I had crashes in the beginning, but they were easily solved. Those were the usual ThreadAccessingUI exceptions (which I still had one recently, but I think I’ve solved all this now) and I also had an app crash twice (I then figured that the internal audio player also needs to be protected by a CriticalSection).
In such case of refactoring, especially since it’s a rather big project, I’m always hoping there won’t be unexpected behaviours (crashes), and I actually made my changes optional (a checkbox, off by default, that the only user to check is me, allows the asynchronous version to be used); the app has come back to a “beta” state after more than 3 years of stable release. I’m considering setting the checkbox to true by default, since the app never crashed when I’m using it live.