• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運(yùn)轉(zhuǎn),開心的工作
            簡(jiǎn)單、開放、平等的公司文化;尊重個(gè)性、自由與個(gè)人價(jià)值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
            0012eff8 7c827d0b 7c83d236 000002bc 00000000 ntdll!KiFastSystemCallRet
            0012effc 7c83d236 000002bc 00000000 00000000 ntdll!NtWaitForSingleObject+0xc
            0012f038 7c83d281 000002bc 00000004 00408ab3 ntdll!RtlpWaitOnCriticalSection+0x1a3
            0012f058 00403db4 0045b3e4 0045b3e0 0012f074 ntdll!RtlEnterCriticalSection+0xa8

            Feedback

            # re: 今天發(fā)現(xiàn) EnterCriticalSection 里頭還是調(diào)用了 WaitForSingleObject[未登錄]  回復(fù)  更多評(píng)論   

            2009-07-22 11:19 by nscboy
            ntdll!NtWaitForSingleObject+0xc
            要確認(rèn)這個(gè)說(shuō)法需要確認(rèn)后面那個(gè)+0xc的具體含義吧。

            # re: 今天發(fā)現(xiàn) EnterCriticalSection 里頭還是調(diào)用了 WaitForSingleObject  回復(fù)  更多評(píng)論   

            2009-07-22 11:52 by 萬(wàn)連文
            這個(gè)是具體的代碼,有些可以確定的東西沒有必要去猜測(cè):

            page , 132
            subttl "RtlEnterCriticalSection"

            ;++
            ;
            ; NTSTATUS
            ; RtlEnterCriticalSection(
            ; IN PRTL_CRITICAL_SECTION CriticalSection
            ; )
            ;
            ; Routine Description:
            ;
            ; This function enters a critical section.
            ;
            ; Arguments:
            ;
            ; CriticalSection - supplies a pointer to a critical section.
            ;
            ; Return Value:
            ;
            ; STATUS_SUCCESS or raises an exception if an error occured.
            ;
            ;--

            align 16
            cPublicProc _RtlEnterCriticalSection,1
            cPublicFpo 1,0

            mov ecx,fs:PcTeb ; get current TEB address
            mov edx,CriticalSection ; get address of critical section
            cmp CsSpinCount[edx],0 ; check if spin count is zero
            jne short Ent40 ; if ne, spin count specified

            ;
            ; Attempt to acquire critical section.
            ;

            Lock1: ;
            lock inc dword ptr CsLockCount[edx] ; increment lock count
            jnz short Ent20 ; if nz, already owned

            ;
            ; Set critical section owner and initialize recursion count.
            ;

            Ent10:
            if DBG
            cmp CsOwningThread[edx],0
            je @F
            stdCall _RtlpCriticalSectionIsOwned, <edx>
            mov ecx,fs:PcTeb ; get current TEB address
            mov edx,CriticalSection ; get address of critical section
            @@:
            endif ; DBG
            mov eax,TbClientId + 4[ecx] ; get current client ID
            mov CsOwningThread[edx],eax ; set critical section owner
            mov dword ptr CsRecursionCount[edx],1 ; set recursion count

            if DBG

            inc dword ptr TbCountOfOwnedCriticalSections[ecx] ; increment owned count
            mov eax,CsDebugInfo[edx] ; get debug information address
            inc dword ptr CsEntryCount[eax] ; increment entry count

            endif ; DBG

            xor eax,eax ; set success status

            stdRET _RtlEnterCriticalSection

            ;
            ; The critical section is already owned, but may be owned by the current thread.
            ;

            align 16
            Ent20: mov eax,TbClientId + 4[ecx] ; get current client ID
            cmp CsOwningThread[edx],eax ; check if current thread is owner
            jne short Ent30 ; if ne, current thread not owner
            inc dword ptr CsRecursionCount[edx] ; increment recursion count

            if DBG

            mov eax,CsDebugInfo[edx] ; get debug information address
            inc dword ptr CsEntryCount[eax] ; increment entry count

            endif ; DBG

            xor eax,eax ; set success status

            stdRET _RtlEnterCriticalSection

            ;
            ; The critcal section is owned by another thread and the current thread must
            ; wait for ownership.
            ;

            Ent30: stdCall _RtlpWaitForCriticalSection, <edx> ; wait for ownership
            mov ecx,fs:PcTeb ; get current TEB address
            mov edx,CriticalSection ; get address of critical section
            jmp Ent10 ; set owner and recursion count

            ;
            ; A nonzero spin count is specified.
            ;

            align 16
            Ent40: mov eax,TbClientId + 4[ecx] ; get current client ID
            cmp CsOwningThread[edx],eax ; check if current thread is owner
            jne short Ent50 ; if ne, current thread not owner

            ;
            ; The critical section is owned by the current thread. Increment the lock
            ; count and the recursion count.
            ;

            Lock6: ;
            lock inc dword ptr CsLockCount[edx] ; increment lock count
            inc dword ptr CsRecursionCount[edx] ; increment recursion count

            if DBG

            mov eax,CsDebugInfo[edx] ; get debug information address
            inc dword ptr CsEntryCount[eax] ; increment entry count

            endif ; DBG

            xor eax,eax ; set success status

            stdRET _RtlEnterCriticalSection

            ;
            ; A nonzero spin count is specified and the current thread is not the owner.
            ;

            align 16
            Ent50: push CsSpinCount[edx] ; get spin count value
            Ent60: mov eax,-1 ; set comparand value
            mov ecx,0 ; set exchange value

            Lock7:
            lock cmpxchg dword ptr CsLockCount[edx],ecx ; attempt to acquire critical section
            jnz short Ent70 ; if nz, critical section not acquired

            ;
            ; The critical section has been acquired. Set the owning thread and the initial
            ; recursion count.
            ;

            add esp,4 ; remove spin count from stack
            mov ecx,fs:PcTeb ; get current TEB address
            mov eax,TbClientId + 4[ecx] ; get current client ID
            mov CsOwningThread[edx],eax ; set critical section owner
            mov dword ptr CsRecursionCount[edx],1 ; set recursion count

            if DBG

            inc dword ptr TbCountOfOwnedCriticalSections[ecx] ; increment owned count
            mov eax,CsDebugInfo[edx] ; get debug information address
            inc dword ptr CsEntryCount[eax] ; increment entry count

            endif ; DBG

            xor eax,eax ; set success status

            stdRET _RtlEnterCriticalSection

            ;
            ; The critical section is currently owned. Spin until it is either unowned
            ; or the spin count has reached zero.
            ;
            ; If waiters are present, don't spin on the lock since we will never see it go free
            ;

            Ent70: cmp CsLockCount[edx],1 ; check if waiters are present,
            jge short Ent76 ; if ge 1, then do not spin

            Ent75: YIELD
            cmp CsLockCount[edx],-1 ; check if lock is owned
            je short Ent60 ; if e, lock is not owned
            dec dword ptr [esp] ; decrement spin count
            jnz short Ent75 ; if nz, continue spinning
            Ent76: add esp,4 ; remove spin count from stack
            mov ecx,fs:PcTeb ; get current TEB address
            jmp Lock1 ;

            stdENDP _RtlEnterCriticalSection

            # re: 今天發(fā)現(xiàn) EnterCriticalSection 里頭還是調(diào)用了 WaitForSingleObject  回復(fù)  更多評(píng)論   

            2009-07-22 18:54 by wocow3
            新的SDk EnterCriticalSection在多核的機(jī)器上會(huì)首先有個(gè)自選量,之后才等待掛起。反正MS也沒公布EnterCriticalSection的實(shí)現(xiàn)細(xì)節(jié),現(xiàn)在調(diào)用了,沒準(zhǔn)以后又不用WaitForSingleObject實(shí)現(xiàn)了

            # re: 今天發(fā)現(xiàn) EnterCriticalSection 里頭還是調(diào)用了 WaitForSingleObject  回復(fù)  更多評(píng)論   

            2009-07-23 06:00 by 沈國(guó)華
            x^n+y^n=z^n,(x,y,z,n為有理數(shù),n>2的正整數(shù))要有解則條件...均為有理數(shù)為充要條件。這樣求解范圍可在整個(gè)復(fù)數(shù)中進(jìn)行。 關(guān)于如何可在復(fù)數(shù)去推行 可由n個(gè)公式共同來(lái)推導(dǎo)。 最簡(jiǎn)單的推導(dǎo)是最難證明的 以前理解了1+0=1 現(xiàn)在明白了0+0=0 要證明更困難了 手機(jī):13567398633
            色诱久久久久综合网ywww| 99久久无码一区人妻a黑| 久久精品国产亚洲AV嫖农村妇女 | 久久国产乱子精品免费女| 久久精品国产亚洲AV蜜臀色欲| 欧美粉嫩小泬久久久久久久| 精品久久久久久国产牛牛app| 国产日产久久高清欧美一区| 99国产欧美久久久精品蜜芽 | 伊人久久大香线蕉综合热线| 欧美一级久久久久久久大| 三级片免费观看久久| 久久久久se色偷偷亚洲精品av| 欧美精品九九99久久在观看| 亚洲欧美另类日本久久国产真实乱对白 | 久久精品中文字幕大胸| 免费无码国产欧美久久18| 2021国产精品午夜久久| 久久婷婷五月综合97色一本一本| 天堂久久天堂AV色综合| 欧美一区二区精品久久| 久久婷婷五月综合色99啪ak| 一本久久a久久精品综合香蕉| 色综合久久久久久久久五月| 国产美女久久精品香蕉69| 国产免费久久精品丫丫| 久久精品桃花综合| 久久99毛片免费观看不卡| 免费精品久久久久久中文字幕| 狠狠色丁香婷婷久久综合五月| 久久亚洲精精品中文字幕| 国产福利电影一区二区三区久久久久成人精品综合 | 久久国语露脸国产精品电影| 久久久精品国产免大香伊| 国产精品久久久久无码av| 午夜精品久久久久久影视777| 少妇高潮惨叫久久久久久| 久久久久国产亚洲AV麻豆| 久久久久亚洲Av无码专| 日韩久久久久中文字幕人妻| 国产精品一区二区久久国产|