reactphysics3d icon indicating copy to clipboard operation
reactphysics3d copied to clipboard

Multithreading and CUDA

Open lp64ace opened this issue 5 years ago • 2 comments

Is it possible to add multithreading computation through std::thread or CUDA for collision world. Specifically I want to be able to cast rays asynchronously and then wait for the answers or something similar.

lp64ace avatar May 28 '20 23:05 lp64ace

Yes it is planned to implement CPU multi-threading. However, I don't have know when exactly. I will release version 0.8.0 of the library in the next days and then focus on robustness. Then I will start working on multi-threading.

DanielChappuis avatar May 31 '20 15:05 DanielChappuis

User defined callbacks running in parallel might cause undefined behavior if they modify a shared state. In order to guarantee thread safety, you'd have to guard user callback invocations with a mutex, or dispatch callback invocations to a single-reader event queue.

mrakh avatar Aug 02 '20 18:08 mrakh