同步技术

事件对象
KeInitializeEvent
IoCreateNotificationEvent
IoCreateSynchronizationEvent


VOID KeInitializeEvent(
    IN PRKEVENT  Event,
    IN EVENT_TYPE  Type,
    IN BOOLEAN  State
    );
The KeInitializeEvent routine initializes an event object as a synchronization (single waiter) or notification type event and sets it to a signaled or not signaled state.
Parameters
Event 
    Pointer to an event object, for which the caller provides the storage. 
Type 
    Specifies the event type, either NotificationEvent or SynchronizationEvent. 
    通知类型的事件有信号时,所有等待该事件的线程全部满足条件并向下执行操作。
    直到该事件被手动设置KeClearEvnet或者KeResetEvent
State 
    Specifies the initial state of the event. TRUE indicates a signaled state. 


信号量对象
KeInitializeSemaphore
KeWaitForSingleObject
KeReleaseSemaphore




VOID 
  KeInitializeSemaphore(
    IN PRKSEMAPHORE  Semaphore,
    IN LONG  Count,
    IN LONG  Limit
    );
The KeInitializeSemaphore routine initializes a semaphore object with a given count and specifies an upper limit that the count can attain.


Parameters
Semaphore 
    Pointer to a dispatcher object of type semaphore, for which the caller provides the storage. 
Count 
    Specifies the initial count value to be assigned to the semaphore. This value must be positive. A nonzero value sets the initial      state of the semaphore to signaled. 
Limit 
    Specifies the maximum count value that the semaphore can attain. This value must be positive. It determines how many waiting 
    threads become eligible for execution when the semaphore is set to the signaled state and can therefore access the resource that 
    the semaphore protects. 


互斥体对象
KeInitializeMutex
KeWaitForSingleObject
KeReleaseMutex


快速互斥体
FAST_MUTEX
ExInitializeFastMutex
ExAcquireFastMutex 一直等待,直到成功
ExTryToAcquireFastMutex 立即返回,要么成功,么要失败
KeReleaseFastMutex


受限互斥体
KGUARDED_MUTEX
ExInitializeGuardedMutex
ExAcquireGuardedMutex 一直等待,直到成功
ExTryToAcquireGuardedMutex 立即返回,要么成功,么要失败
KeReleaseGuardedMutex
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值