为什么(以及如何)互斥体可以处理优先级反转,而信号量则不能?
我在很多地方读到互斥锁和信号量之间的区别(其中之一)是优先级反转,有人可以解释一下吗?
最佳答案
来自Wikipedia :
Since the mutex knows its current owner, it is possible to promote the priority of the owner whenever a higher-priority task starts waiting on the mutex.
关于multithreading - 互斥体与信号量中的优先级反转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17777807/