dimforge / rapier

2D and 3D physics engines focused on performance.
https://rapier.rs
Apache License 2.0
3.8k stars 236 forks source link

hey, is there a way to use Rapier without rayon ? #494

Closed Kiddinglife closed 1 year ago

Kiddinglife commented 1 year ago

Hey, my game server is built up on the basis of Tokio async runtime. so I want to call rapier api via the threads in the runtime instead of Rayon. Is it easy to let the api user decide the threading model of rapier collision apis ? Thank you very much !

sebcrozet commented 1 year ago

Hi! It is not possible to switch to a threading model other than rayon when multi-threading is enabled for rapier. async is generally not considered suited for compute-heavy tasks where rayon’s work-stealing scheduler is more suited.

Kiddinglife commented 1 year ago

hey mate, my game dev is in and cpu heavy app at the same time. No good trade off for me. Either losing asynchrony support or losing rayon support. I chose losing rayon and do the dirty jobs of parallel myself. Anyway close now.