facebookexperimental / facebookexperimental/libunifex

Mutex::unlock serialize code after it

Open
#449 10 comments 0 reactions 1 assignee Claimed by @ispeters View on GitHub
bug
Dominant language
C++
Stars
1.7k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

I think it's really bad that mutex serialize all waiters to single thread.

I think unlock should be something like this, if it async:
Executor.Schedule(after unlock code);
ExecuteHere(next critical section)

But we don't have async dtor :(, so for unique lock something like:
Executor.Schedule(next critical section)
ExecuteHere(after unlock code)

But now test like this doesn't work:
https://github.com/YACLib/YACLib/blob/main/test/unit/coro/async_mutex.cpp#L273

Check Unlock in our library:
https://github.com/YACLib/YACLib/blob/main/include/yaclib/coro/async_mutex.hpp

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.