亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? readme.cv

?? pthread source code,you can compile directly
?? CV
?? 第 1 頁 / 共 5 頁
字號:
README.CV -- Condition Variables--------------------------------The original implementation of condition variables inpthreads-win32 was based on a discussion paper:"Strategies for Implementing POSIX Condition Variableson Win32": http://www.cs.wustl.edu/~schmidt/win32-cv-1.htmlThe changes suggested below were made on Feb 6 2001. Thisfile is included in the package for the benefit of anyoneinterested in understanding the pthreads-win32 implementationof condition variables and the (sometimes subtle) issues thatit attempts to resolve.Thanks go to the individuals whose names appear throughoutthe following text.Ross Johnson--------------------------------------------------------------------fyi.. (more detailed problem description/demos + possible fix/patch)regards,alexander.Alexander Terekhov31.01.2001 17:43To:   ace-bugs@cs.wustl.educc:From: Alexander Terekhov/Germany/IBM@IBMDESubject:  Implementation of POSIX CVs: spur.wakeups/lost      signals/deadlocks/unfairness    ACE VERSION:        5.1.12 (pthread-win32 snapshot 2000-12-29)    HOST MACHINE and OPERATING SYSTEM:        IBM IntelliStation Z Pro, 2 x XEON 1GHz, Win2K    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:    COMPILER NAME AND VERSION (AND PATCHLEVEL):        Microsoft Visual C++ 6.0    AREA/CLASS/EXAMPLE AFFECTED:        Implementation of POSIX condition variables - OS.cpp/.h    DOES THE PROBLEM AFFECT:        EXECUTION? YES!    SYNOPSIS:        a) spurious wakeups (minor problem)        b) lost signals        c) broadcast deadlock        d) unfairness (minor problem)    DESCRIPTION:        Please see attached copy of discussion thread        from comp.programming.threads for more details on        some reported problems. (i've also posted a "fyi"        message to ace-users a week or two ago but        unfortunately did not get any response so far).        It seems that current implementation suffers from        two essential problems:        1) cond.waiters_count does not accurately reflect           number of waiters blocked on semaphore - w/o           proper synchronisation that could result (in the           time window when counter is not accurate)           in spurious wakeups organised by subsequent           _signals  and _broadcasts.        2) Always having (with no e.g. copy_and_clear/..)           the same queue in use (semaphore+counter)           neither signal nor broadcast provide 'atomic'           behaviour with respect to other threads/subsequent           calls to signal/broadcast/wait.        Each problem and combination of both could produce        various nasty things:        a) spurious wakeups (minor problem)             it is possible that waiter(s) which was already             unblocked even so is still counted as blocked             waiter. signal and broadcast will release             semaphore which will produce a spurious wakeup             for a 'real' waiter coming later.        b) lost signals             signalling thread ends up consuming its own             signal. please see demo/discussion below.        c) broadcast deadlock             last_waiter processing code does not correctly             handle the case with multiple threads             waiting for the end of broadcast.             please see demo/discussion below.        d) unfairness (minor problem)             without SignalObjectAndWait some waiter(s)             may end up consuming broadcasted signals             multiple times (spurious wakeups) because waiter             thread(s) can be preempted before they call             semaphore wait (but after count++ and mtx.unlock).    REPEAT BY:        See below... run problem demos programs (tennis.cpp and        tennisb.cpp) number of times concurrently (on multiprocessor)        and in multiple sessions or just add a couple of "Sleep"s        as described in the attached copy of discussion thread        from comp.programming.threads    SAMPLE FIX/WORKAROUND:        See attached patch to pthread-win32.. well, I can not        claim that it is completely bug free but at least my        test and tests provided by pthreads-win32 seem to work.        Perhaps that will help.        regards,        alexander.>> Forum: comp.programming.threads>> Thread: pthread_cond_* implementation questions...David Schwartz <davids@webmaster.com> wrote:> terekhov@my-deja.com wrote:>>> BTW, could you please also share your view on other perceived>> "problems" such as nested broadcast deadlock, spurious wakeups>> and (the latest one) lost signals??>>I'm not sure what you mean. The standard allows an implementation>to do almost whatever it likes. In fact, you could implement>pthread_cond_wait by releasing the mutex, sleeping a random>amount of time, and then reacquiring the mutex. Of course,>this would be a pretty poor implementation, but any code that>didn't work under that implementation wouldn't be strictly>compliant.The implementation you suggested is indeed correctone (yes, now I see it :). However it requires fromsignal/broadcast nothing more than to "{ return 0; }"That is not the case for pthread-win32 and ACEimplementations. I do think that these implementations(basically the same implementation) have some seriousproblems with wait/signal/broadcast calls. I am lookingfor help to clarify whether these problems are realor not. I think that I can demonstrate what I meanusing one or two small sample programs....==========tennis.cpp==========#include "ace/Synch.h"#include "ace/Thread.h"enum GAME_STATE {  START_GAME,  PLAYER_A,     // Player A playes the ball  PLAYER_B,     // Player B playes the ball  GAME_OVER,  ONE_PLAYER_GONE,  BOTH_PLAYERS_GONE};enum GAME_STATE             eGameState;ACE_Mutex*                  pmtxGameStateLock;ACE_Condition< ACE_Mutex >* pcndGameStateChange;void*  playerA(    void* pParm  ){  // For access to game state variable  pmtxGameStateLock->acquire();  // Play loop  while ( eGameState < GAME_OVER ) {    // Play the ball    cout << endl << "PLAYER-A" << endl;    // Now its PLAYER-B's turn    eGameState = PLAYER_B;    // Signal to PLAYER-B that now it is his turn    pcndGameStateChange->signal();    // Wait until PLAYER-B finishes playing the ball    do {      pcndGameStateChange->wait();      if ( PLAYER_B == eGameState )        cout << endl << "----PLAYER-A: SPURIOUS WAKEUP!!!" << endl;    } while ( PLAYER_B == eGameState );  }  // PLAYER-A gone  eGameState = (GAME_STATE)(eGameState+1);  cout << endl << "PLAYER-A GONE" << endl;  // No more access to state variable needed  pmtxGameStateLock->release();  // Signal PLAYER-A gone event  pcndGameStateChange->broadcast();  return 0;}void*  playerB(    void* pParm  ){  // For access to game state variable  pmtxGameStateLock->acquire();  // Play loop  while ( eGameState < GAME_OVER ) {    // Play the ball    cout << endl << "PLAYER-B" << endl;    // Now its PLAYER-A's turn    eGameState = PLAYER_A;    // Signal to PLAYER-A that now it is his turn    pcndGameStateChange->signal();    // Wait until PLAYER-A finishes playing the ball    do {      pcndGameStateChange->wait();      if ( PLAYER_A == eGameState )        cout << endl << "----PLAYER-B: SPURIOUS WAKEUP!!!" << endl;    } while ( PLAYER_A == eGameState );  }  // PLAYER-B gone  eGameState = (GAME_STATE)(eGameState+1);  cout << endl << "PLAYER-B GONE" << endl;  // No more access to state variable needed  pmtxGameStateLock->release();  // Signal PLAYER-B gone event  pcndGameStateChange->broadcast();  return 0;}intmain (int, ACE_TCHAR *[]){  pmtxGameStateLock   = new ACE_Mutex();  pcndGameStateChange = new ACE_Condition< ACE_Mutex >( *pmtxGameStateLock);  // Set initial state  eGameState = START_GAME;  // Create players  ACE_Thread::spawn( playerA );  ACE_Thread::spawn( playerB );  // Give them 5 sec. to play  Sleep( 5000 );//sleep( 5 );  // Set game over state  pmtxGameStateLock->acquire();  eGameState = GAME_OVER;  // Let them know  pcndGameStateChange->broadcast();  // Wait for players to stop  do {    pcndGameStateChange->wait();  } while ( eGameState < BOTH_PLAYERS_GONE );  // Cleanup  cout << endl << "GAME OVER" << endl;  pmtxGameStateLock->release();  delete pcndGameStateChange;  delete pmtxGameStateLock;  return 0;}===========tennisb.cpp===========#include "ace/Synch.h"#include "ace/Thread.h"enum GAME_STATE {  START_GAME,  PLAYER_A,     // Player A playes the ball  PLAYER_B,     // Player B playes the ball  GAME_OVER,  ONE_PLAYER_GONE,  BOTH_PLAYERS_GONE};enum GAME_STATE             eGameState;ACE_Mutex*                  pmtxGameStateLock;ACE_Condition< ACE_Mutex >* pcndGameStateChange;void*  playerA(    void* pParm  ){  // For access to game state variable  pmtxGameStateLock->acquire();  // Play loop  while ( eGameState < GAME_OVER ) {    // Play the ball    cout << endl << "PLAYER-A" << endl;    // Now its PLAYER-B's turn    eGameState = PLAYER_B;    // Signal to PLAYER-B that now it is his turn    pcndGameStateChange->broadcast();    // Wait until PLAYER-B finishes playing the ball    do {      pcndGameStateChange->wait();      if ( PLAYER_B == eGameState )        cout << endl << "----PLAYER-A: SPURIOUS WAKEUP!!!" << endl;    } while ( PLAYER_B == eGameState );  }  // PLAYER-A gone  eGameState = (GAME_STATE)(eGameState+1);  cout << endl << "PLAYER-A GONE" << endl;  // No more access to state variable needed  pmtxGameStateLock->release();  // Signal PLAYER-A gone event  pcndGameStateChange->broadcast();  return 0;}void*  playerB(    void* pParm  ){  // For access to game state variable  pmtxGameStateLock->acquire();  // Play loop  while ( eGameState < GAME_OVER ) {    // Play the ball    cout << endl << "PLAYER-B" << endl;    // Now its PLAYER-A's turn    eGameState = PLAYER_A;    // Signal to PLAYER-A that now it is his turn    pcndGameStateChange->broadcast();    // Wait until PLAYER-A finishes playing the ball    do {      pcndGameStateChange->wait();      if ( PLAYER_A == eGameState )        cout << endl << "----PLAYER-B: SPURIOUS WAKEUP!!!" << endl;    } while ( PLAYER_A == eGameState );  }  // PLAYER-B gone  eGameState = (GAME_STATE)(eGameState+1);  cout << endl << "PLAYER-B GONE" << endl;  // No more access to state variable needed  pmtxGameStateLock->release();  // Signal PLAYER-B gone event  pcndGameStateChange->broadcast();  return 0;}intmain (int, ACE_TCHAR *[]){  pmtxGameStateLock   = new ACE_Mutex();  pcndGameStateChange = new ACE_Condition< ACE_Mutex >( *pmtxGameStateLock);  // Set initial state  eGameState = START_GAME;  // Create players  ACE_Thread::spawn( playerA );  ACE_Thread::spawn( playerB );  // Give them 5 sec. to play  Sleep( 5000 );//sleep( 5 );  // Make some noise  pmtxGameStateLock->acquire();  cout << endl << "---Noise ON..." << endl;  pmtxGameStateLock->release();  for ( int i = 0; i < 100000; i++ )    pcndGameStateChange->broadcast();  cout << endl << "---Noise OFF" << endl;  // Set game over state  pmtxGameStateLock->acquire();  eGameState = GAME_OVER;  cout << endl << "---Stopping the game..." << endl;  // Let them know  pcndGameStateChange->broadcast();  // Wait for players to stop  do {    pcndGameStateChange->wait();  } while ( eGameState < BOTH_PLAYERS_GONE );  // Cleanup  cout << endl << "GAME OVER" << endl;  pmtxGameStateLock->release();  delete pcndGameStateChange;  delete pmtxGameStateLock;  return 0;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲18影院在线观看| 日韩中文字幕91| 亚洲一区在线观看视频| 久久精品国产亚洲a| 色综合天天综合在线视频| 日韩写真欧美这视频| 国产精品卡一卡二| 美女看a上一区| 日本道色综合久久| 亚洲国产精品激情在线观看| 亚洲在线观看免费视频| 国产精品一二三区| 精品国产乱码久久久久久1区2区 | 日韩午夜av电影| 亚洲欧美成人一区二区三区| 老鸭窝一区二区久久精品| 欧美午夜电影在线播放| 精品国产青草久久久久福利| 亚洲一区二区三区国产| www.欧美精品一二区| 久久人人爽爽爽人久久久| 亚洲国产精品人人做人人爽| 99久久精品免费看国产 | 日韩国产精品久久久| 91一区在线观看| 国产日韩精品一区二区三区在线| 蜜桃91丨九色丨蝌蚪91桃色| 91成人免费在线视频| 国产日产欧美一区二区视频| 亚洲成人www| 在线国产电影不卡| 亚洲日本在线视频观看| 97久久超碰国产精品| 日韩一区二区三区免费看 | 欧美亚洲综合网| 亚洲一区国产视频| 欧美精品自拍偷拍动漫精品| 亚洲成av人片| 制服丝袜亚洲网站| 青青草原综合久久大伊人精品优势 | 韩国一区二区在线观看| 欧美videofree性高清杂交| 久久国产剧场电影| 精品国产一区二区三区久久久蜜月 | 日韩欧美的一区| 激情国产一区二区| 欧美高清在线一区二区| 暴力调教一区二区三区| 一级做a爱片久久| 4438x成人网最大色成网站| 美女精品一区二区| 久久久久久毛片| 不卡视频一二三四| 亚洲一区二区三区四区在线 | 日韩精品一区二区三区中文精品| 免费在线视频一区| 国产调教视频一区| 99精品国产热久久91蜜凸| 亚洲男同性视频| 欧美乱妇20p| 国产美女在线精品| 中文字幕在线一区免费| 99精品久久只有精品| 日韩二区三区四区| 国产精品美女久久久久高潮| 一本高清dvd不卡在线观看| 亚洲欧美日本在线| 色综合天天综合在线视频| 日韩精品欧美精品| 国产精品久久久久久妇女6080| 欧美日韩精品欧美日韩精品一 | 亚洲成人动漫精品| 久久久亚洲精品一区二区三区| 一本一道波多野结衣一区二区| 青娱乐精品在线视频| 亚洲欧美经典视频| 欧美成人乱码一区二区三区| 成人免费看片app下载| 日韩极品在线观看| 亚洲欧美日韩国产中文在线| 在线不卡一区二区| 成人18视频在线播放| 免费在线观看成人| 国产精品传媒视频| 日韩午夜三级在线| 欧美午夜电影网| 东方aⅴ免费观看久久av| 日韩精品一二区| 亚洲欧洲av在线| 精品国产91乱码一区二区三区| 欧美最猛性xxxxx直播| www.一区二区| 国产精品456| 久久av资源网| 免费成人小视频| 午夜精品一区二区三区电影天堂| 亚洲私人影院在线观看| 久久久九九九九| 日韩美一区二区三区| 欧美人xxxx| 欧美视频自拍偷拍| 99国产精品久| 不卡的av在线| 粉嫩在线一区二区三区视频| 国内精品久久久久影院薰衣草| 日本中文字幕一区| 日韩国产欧美在线观看| 99精品桃花视频在线观看| 欧美tickle裸体挠脚心vk| 午夜精品在线看| 久久99精品久久只有精品| 亚洲国产精品人人做人人爽| 亚洲欧美另类小说| 亚洲精品高清视频在线观看| 国产精品久久久久久久浪潮网站| 2021久久国产精品不只是精品| 欧美精品一区二区精品网| 欧美mv日韩mv国产| 国产日韩亚洲欧美综合| 国产亚洲人成网站| 中文字幕一区三区| 亚洲免费伊人电影| 亚洲一区二区三区中文字幕| 亚洲国产精品久久久久婷婷884 | 91麻豆精品国产91久久久资源速度 | 亚洲美女在线国产| 亚洲精品国产无天堂网2021 | 国产乱码精品一区二区三区五月婷| 老司机午夜精品99久久| 国产呦萝稀缺另类资源| 国产成人无遮挡在线视频| 大尺度一区二区| 91麻豆成人久久精品二区三区| 91福利国产成人精品照片| 777久久久精品| 精品国产三级a在线观看| 国产日韩欧美麻豆| 亚洲女同ⅹxx女同tv| 日日夜夜精品视频天天综合网| 丝袜美腿亚洲色图| 国产美女视频一区| 色综合久久中文综合久久牛| 欧美日韩精品欧美日韩精品一综合| 欧美一区二区不卡视频| 国产日产欧美一区二区视频| 亚洲老司机在线| 麻豆91在线观看| 99麻豆久久久国产精品免费优播| 欧美视频在线一区| 日韩美女视频在线| 日韩久久一区二区| 九九精品一区二区| 色偷偷久久人人79超碰人人澡| 欧美一级久久久| 亚洲天堂成人网| 六月丁香综合在线视频| 色女孩综合影院| 26uuu国产电影一区二区| 亚洲精品一二三| 国内不卡的二区三区中文字幕| 色94色欧美sute亚洲线路二| 久久综合色之久久综合| 亚洲一区二区在线观看视频| 久久99精品国产.久久久久| 91色九色蝌蚪| 久久久久97国产精华液好用吗| 天天操天天色综合| 91网页版在线| 国产日韩欧美一区二区三区综合| 午夜国产不卡在线观看视频| 成人av资源下载| 精品成人在线观看| 免费在线观看精品| 欧美主播一区二区三区| 国产精品福利一区二区| 国产在线看一区| 欧美一区二区三区色| 亚洲国产日韩综合久久精品| 成人精品视频.| 国产亚洲一区二区三区在线观看| 日日摸夜夜添夜夜添国产精品 | 丰满少妇在线播放bd日韩电影| 56国语精品自产拍在线观看| 亚洲自拍偷拍网站| 99久久国产综合色|国产精品| 久久伊人蜜桃av一区二区| 美女www一区二区| 精品视频1区2区| 亚洲国产精品久久人人爱蜜臀| 91美女蜜桃在线| 亚洲免费观看高清完整版在线观看 | 欧美一区二区大片| 午夜电影一区二区| 欧美日韩精品欧美日韩精品一综合| 亚洲欧美国产高清| 国产a视频精品免费观看| 久久精品水蜜桃av综合天堂| 激情伊人五月天久久综合| 精品盗摄一区二区三区| 免费在线观看日韩欧美|