A-New-BellHope / bellhopcuda

CUDA and C++ port of BELLHOP / BELLHOP3D underwater acoustics simulator
GNU General Public License v3.0
60 stars 7 forks source link

fetch add for rayID #3

Closed oldstylejoe closed 2 years ago

oldstylejoe commented 2 years ago

There's a todo in trace_dll (to be renamed trace_lib) where the atomic increment and assignment resulted in thread issues. Currently a mutex is hacked in to take care of it, but a general solution should be doable.

lpisha commented 2 years ago

Please create a test program or provide some sort of reproducible evidence for operator++ on std::atomic<int32_t> failing to return correct unique values on multiple threads on Windows on C++14. This same mechanism is used in other places in the codebase, so if I/we have a bug in my/our usage of it, that's critical to know.

oldstylejoe commented 2 years ago

I couldn't reproduce, so I'm closing this. I probably did something else wrong.