-
我看 Mutex 的实现是用的 pthread_mutex_lock,这个不会锁了 scheduler 吗?还是有更高层次上的处理? |
Beta Was this translation helpful? Give feedback.
Answered by
idealvin
Mar 3, 2022
Replies: 3 comments 7 replies
-
那只是轻粒度的,主要逻辑不会被锁住 |
Beta Was this translation helpful? Give feedback.
0 replies
-
不是粒度的问题,持有同一把锁的两个协程在一个线程内调度,如果一个在锁中执行了 sleep 之类的换出行为,是不是会发生调度性死锁。 |
Beta Was this translation helpful? Give feedback.
7 replies
-
pthread_mutex_lock 并不是必须的,不会造成调度线程死锁 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
idealvin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pthread_mutex_lock 并不是必须的,不会造成调度线程死锁