??Windows????????С?????????μ???????
???????????? ???????[ 2012/10/17 10:55:12 ] ????????
??????д????RWLock??
??????д?????????????????б?????????????????????????????д????????????????Щ????????????????????????????????е?????????????????????е??????????????????????е?д??????????д?????????????д??????????????????????????????????д??????????????
????????д????????????????SRWLOCK??????????InitializeSRWLock?????????
Void InitializeSRWLock(PSRWLOCK SRWLock);
???????????????д?????????????AcquireSRWLockExclusive????SRWLock???????????????????????????????
Void AcquireSRWLockExclusive(PSRWLOCK SRWLock);
????????????????????????
Void ReleaseSRWLockExclusive(PSRWLOCK SRWLock);
??????????????????
????????????????????????????
Void AcquireSRWLockShared(PSRWLOCK SRWLock);
????????????????????
Void ReleaseSRWLockShared(PSRWLOCK SRWLock);
?????????????????
??????д???????????д?????????????????????????ε???ReleaseSRWLock*??????????????? ??
?????????????Щ???????????????????????????????x ms?????????????????????佫??>2x?????????????????????ж??cpu??????????????????????????????Cpu?????????????????
??????д????ж?????????????????д??????????????????????????????????????д???????????????д??
????????????????????????д?????????????????Щ??????д??????????????????????????????????????????д???????????????????????????????????????????????????????????????API?????????????????????????????л??????????????????????????????????????????
????????д???????????????-??????????
??????????????????????????????y?????????????????????д???????????????д???????????д??????????????????????????????????????????????????????windows????????Щ??????????Щ??????
????Windows??SleepConditionVariableCS??SleepConditionVariableSRW???????????????????????????????????????????????????????????????????????????????????????????
<SPAN style="FONT-SIZE: 18px">Bool SleepConditionVariableCS(
PCONDITION_VARIABLE pConditionVariable??
PCRITICAL_SECTION pCriticalSection??
DWORD dwMilliseconds);
Bool SleepConditionVariableSRW(
PCONDITION_VARIABLE pConditionVariable??
PSRWLOCK pSRWLock??
DWORD dwMilliseconds
ULONG Flags);</SPAN>
????pConditonVariable??????????????????????????????????????????????????????????????????λ???SRWLock?????ù???λ?SRWLock?????????????????????Flags??????????????????????????????????????????????????????????CONDITION_VARIABLE_LOCKMODE_SHARED????????????????????????д?????????????0?????????????
????dwMilliseconds????????????????????????????????????????????????????????????????????δ????????????????false???????true??
???????????????????????????????????????????????????????????????????????WakeConditionVariable??WakeAllConditionVariable????????????????????????Sleep*????????????????????????????????
<SPAN style="FONT-SIZE: 18px">Void WakeConditonVariable(
PCONDITION_VARIABLE ConditionVariable);
Void WakeAllConditionVariable(
PCONDITION_VARIABLE ConditionVariable);</SPAN>
????WakeConditionVariable???SleepConditionVariable*???????????????????????????????????????????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11