ホーム » MFC » CCriticalSection と CMutex

2010年4月
 123
45678910
11121314151617
18192021222324
252627282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 80,208 アクセス



CCriticalSection と CMutex

それぞれ,500,000 回呼出した時間 (m sec) 

      P4       VirtualPC     Xeon    
CCriticalSection 734 160 94
*1 78 20 15
CMutex 8200 710 1140
*1 950 250 437
Profile          INI 2900 950 920
Reg 2100 570 740

  ElapseTick et_cs ;
  {
     CCriticalSection cs ;
     for (int index=0 ; index<500000 ; index++) {
     //CCriticalSection cs ;
        cs.Lock() ;
        cs.Unlock() ;
        }
     }
  DWORD e_cs = et_cs.GetElapse() ;

  ElapseTick et_me ;
  {
     CMutex mt ;
     for (int index=0 ; index<500000 ; index++) {
       mt.Lock() ;
       mt.Unlock() ;
       }
     }

  DWORD e_me = et_me.GetElapse() ;

  ElapseTick et_pr ;
  {
     Profile profile ;
     for (int index=0 ; index<500000 ; index++) {
       int data = profile.GetInt(_T("Test"),_T("Test"),100) ;
       }
     }
  DWORD e_pr = et_pr.GetElapse() ;

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。