Closed ChuanqiXu9 closed 9 months ago
I will try to fix it later.
ConditionVariable没实现coAwait的话,我记得会走ViaCoroutine回到之前suspend的线程,不会卡nofity线程吧
ConditionVariable没实现coAwait的话,我记得会走ViaCoroutine回到之前suspend的线程,不会卡nofity线程吧
是的,所以这个issue可以close了,只要发起wait的协程有绑定调度器,notify就会通过ViaCoroutine调度回去。如果没有绑定调度器则会原地执行。
Now
coro::ConditionVariable::notify*()
will resume all the awaiting tasks in the notifying thread. It is not desired. The notifying thread may be blocked. Also this behavior violates the design principles of async_simple.The expected behaviors may be that the
coro::ConditionVariable::notify()
should send all (or one) the waiting Lazy to the executor of the corresponding Lazy(s). Maybe it will be good to havenotify*(Executor*)
overloads to schedule the Lazy(s) not owned by executors by the specified Executors.Note that this change may require CondtionVariable to be called in Lazy Coroutines, which may introduce a break change.
CC: @poor-circle