Fiber Aware Mutex #1921
Unanswered
endevagames
asked this question in
Q&A
Replies: 2 comments
|
You can already override the mutex by defining I'd prefer not to add yet another layer of overridability on top of this. |
0 replies
|
Yeah that makes sense. Thanks for the note about behaviour when profiling is enabled! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I've been integrating Jolt into a custom engine and I came across an issue with fiber based job systems.
PhysicsSystem::Update acquires mutexes internally (i.e. the broad phase SharedMutex via MutexArray). If the job system suspends a fiber while it holds one of these locks and later resumes it on a different thread, the unlock happens on a thread that didn't acquire the lock. Which is UB that can cause deadlocking. I'm pretty sure there's a debug assert for this in the repo.
There's two solutions:
I've done both on my own vendored repo but I was wondering if there was any appetite for this in the main repo. Jolt already has precedent for engine-injectable primitives (JPH::Allocate/JPH::Free) so something similar could be possible.
All reactions