To try and give some guidance to this part of your questions: I don’t see where a race condition should occur just from the code you posted. A race condition can occur when multiple threads write to the same piece of memory, so just reading a constant value is totally fine. Your original code piece also shows that you pass completely unrelated values/arrays to the run_test function so everything is fine on this level. Are you sharing/reusing some datastructures among different runs?
2 Likes