FastNoise2 icon indicating copy to clipboard operation
FastNoise2 copied to clipboard

Thread safety crash when launching noises from background thread.

Open vblanco20-1 opened this issue 1 year ago • 3 comments

With std::shared ptr option on or off. Doesnt matter. Happens randomly.

Seems to be related to https://github.com/Auburn/FastNoise2/issues/100 which happens again.

To replicate: Use taskflow or other similar parallel lib to launch multiple generators at once, in my project im launching 4 tasks to do noises at the same time. It seems initialization of simd structures causes a race condition. Currently debugging what is going on here to add more info to this issue.

vblanco20-1 avatar May 12 '24 11:05 vblanco20-1

I've seen some other instances of this, I think I've got a proper fix for it in the upcoming release. In the mean time try calling GetSIMDLevel() on the main thread before starting your threads, which should stop the threads contesting the initialisation

Auburn avatar May 12 '24 17:05 Auburn