Suggestion: mutex and condition variable
Open
- Dominant language
- C++
- Stars
- 347
- Forks
- 47
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 1
Description
If we have two threads, and both have cobalt coroutines running, a coroutine may want to access some piece of shared data and would want to block until it became available.
If there are other coroutines ready on that thread, we wouldn't want to use std::mutex or std::condition_variable in this case because that would block the entire thread rather than just that coroutine.
There have been a few efforts in this direction, like [this](https://github.com/jbaldwin/libcoro/blob/main/src/mutex.cpp)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.