线程Signaled nonsignaled状态的意思

 

常见的线程同步方法(对象)有: 

    互斥对象(Mutex),事件对象(Event),信号量(Semaphore),临界区(critical section)等。 

Synchronization Functions[1] 

    在同步过程中,两个最重要的概念是同步对象和等待函数。 

    在线程同步过程中,需要先定义一个同步对象,同步对象一般具有两种状态:标志的(置位,signaled)和未标志的(未置位,nonsignaled)。线程根据是否已经完成操作将同步对象设置为标志的或未标志的。

    而等待函数的功能是专门用于等待同步对象状态改变。一个线程调用等待函数后执行会暂停,直到同步对象的状态改变后,等待函数才会返回,线程才会继续执行。等待函数分为“单对象”等待函数和“多对象”等待函数。

What is Signaled State?

One of two possible states for kernel-defined dispatcher objects, which support

synchronization. When the kernel sets such an object to the Signaled state, any threads

waiting on the object are released from their wait and become eligible for execution.

Wait handles have two states, signaled and nonsignaled. A wait handle that is not

owned by any thread is in the signaled state. A wait handle that is owned by a thread is in

the nonsignaled state.[2]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值