Closed texnokrates closed 7 years ago
Thanks for taking the time to debug and fix that. Your analysis is correct of course. Not sure what I was thinking---must have been rushing to get something working quickly in a non-multithreaded code and left it in there by mistake.
Hi,
one can't simply use static variables in multi-threaded code like this. I guess the purpose of the previous version was to avoid allocation on every call, but it simply does not work (scuff-tmatrix will crash on multicore machine) and the performance gain would be insignificant anyway – there are ways to do that correctly, but it is in my opinion not worth it just to save two tiny allocations and one gsl_sf_legendre_array_n per call.
Marek