Skip to content

Thread-safety #341

@galvesribeiro

Description

@galvesribeiro

Hello!

First of all, thank you for the library! It is really nice to find something like this performing so well in the .Net space!

We've been using PhysX 5 with a C# binding for a while but it natively doesn't support concurrent readers/writers which is a problem for us since the server is built on top a distributed system (Microsoft Orleans). PhysX require us to either use their native locks or to do lock and synchronization at the C# side which is a big performance hit which causes a lot of CPU contention.

So, we are evaluating other options for physics libraries for our server. We don't have very strict requirements besides kinematics and rigid bodies since the game in development is a (unannounced) MMO and hence why I've stumbled here when I found a Reddit post mentioning this library being as fast as PhysX and Jolt.

My question for you is: I understand that you have some support for scheduling the simulation tasks on multiple threads but, what about the methods that read and write from the simulation? Are they thread-safe? In our scenario the server operates in a distributed system as mentioned, where each entity essentially run in its own thread. Those entities will query a lot the state of itself and others on the simulation and may also update itself (i.e. character movement) on the simulation. The current approach is to "queue" all those updates and have a pump-loop on a single thread that acquires a write lock for PhysX in order to write and that write lock also lock all the reads essentially using a ReadWriteLock.

So, is Bebu behaving similar to PhysX where we need to manage those locks or is it multithread friendly as Jolt?

Again, thank you!

Looking forward to hear from you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions