本文介绍了信号量优先的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道System.Threading
命名空间中的Semaphore
类,但是我不知道它是否允许等待线程具有不同的优先级.
I know about the Semaphore
class in the System.Threading
namespace, but I don't see if it allows waiting threads to have different priorities levels.
如果两个线程正在等待一个开放的插槽,是否可以让优先级较高的线程拥有第一个开放的插槽?
If two threads are waiting for an open slot, is there a way to allow the thread with the higher priority to have the first open slot available?
推荐答案
但是看看这两个都支持线程优先级的项目.
But take a look at these two projects which both supports priority for threads.
这篇关于信号量优先的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!