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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人99免费视频| 综合精品久久久| 蓝色福利精品导航| 欧美va天堂va视频va在线| 美女www一区二区| 国产亚洲短视频| 成人黄色av网站在线| 有坂深雪av一区二区精品| 欧美色电影在线| 日产精品久久久久久久性色| 久久免费午夜影院| 99久久免费精品| 视频一区二区欧美| 久久久久久久精| 色婷婷精品久久二区二区蜜臂av| 亚洲国产aⅴ成人精品无吗| 欧美精品aⅴ在线视频| 精品中文字幕一区二区小辣椒| 国产欧美综合在线| 色婷婷久久久久swag精品 | 国产欧美1区2区3区| 成人听书哪个软件好| 亚洲综合色视频| 日韩欧美一区二区在线视频| 国产激情偷乱视频一区二区三区 | 一区在线播放视频| 欧美色手机在线观看| 久久精品国产在热久久| 亚洲欧美综合另类在线卡通| 欧美人妇做爰xxxⅹ性高电影| 国产专区综合网| 亚洲一区在线观看网站| 久久久久国产成人精品亚洲午夜| 色婷婷亚洲精品| 国产麻豆一精品一av一免费 | 日日摸夜夜添夜夜添亚洲女人| 久久九九影视网| 欧美日韩情趣电影| 成人黄色在线网站| 久久精品国产精品青草| 亚洲一区二区三区精品在线| 久久久综合激的五月天| 欧美日韩在线播放三区| 不卡一区中文字幕| 韩国成人福利片在线播放| 亚洲午夜久久久久中文字幕久| 国产欧美日韩在线视频| 6080日韩午夜伦伦午夜伦| a在线播放不卡| 国产精品一区二区91| 蜜臀av一区二区在线免费观看| 国产精品视频看| 欧美精品一区二区三区很污很色的| 欧美在线影院一区二区| 成人av网在线| 国产精品99久久久久久有的能看 | 强制捆绑调教一区二区| 亚洲欧美日韩人成在线播放| 国产清纯白嫩初高生在线观看91| 日韩欧美一区中文| 欧美一区二区久久久| 欧美日韩美少妇| 欧美日韩二区三区| 欧美亚洲丝袜传媒另类| 99re这里只有精品6| 不卡视频一二三| 成人动漫av在线| 成人18视频在线播放| 从欧美一区二区三区| 久久99久久99精品免视看婷婷 | 一区二区三区在线观看国产| 中文字幕巨乱亚洲| 日本一区二区视频在线观看| 久久香蕉国产线看观看99| 久久日韩粉嫩一区二区三区 | 精品第一国产综合精品aⅴ| 欧美日韩大陆一区二区| 欧美日韩免费一区二区三区| 在线免费观看日本欧美| 日本高清不卡视频| 欧美在线一区二区三区| 欧美亚洲另类激情小说| 91福利小视频| 欧美乱妇15p| 在线电影国产精品| 日韩一区二区在线看| 欧美大黄免费观看| 日韩精品一区二区三区中文不卡| 日韩视频123| 中文字幕一区av| 亚洲天堂a在线| 一区二区三区日韩精品| 亚洲综合在线免费观看| 日韩专区在线视频| 激情深爱一区二区| 国产精品自产自拍| 不卡av电影在线播放| 91精品91久久久中77777| 色综合激情久久| 欧美久久久久久蜜桃| 日韩欧美123| 中文字幕乱码亚洲精品一区| 伊人性伊人情综合网| 亚洲3atv精品一区二区三区| 另类的小说在线视频另类成人小视频在线| 欧美videossexotv100| 久久久久青草大香线综合精品| 国产精品婷婷午夜在线观看| 亚洲欧美日韩电影| 男人的j进女人的j一区| 国产99精品在线观看| 成人激情动漫在线观看| 欧美视频一区二区| 亚洲精品一区在线观看| 中文字幕五月欧美| 免费在线观看日韩欧美| 成人在线综合网| 欧美猛男超大videosgay| 亚洲精品一区在线观看| 亚洲精品一二三| 九九久久精品视频| 日本二三区不卡| 久久亚洲欧美国产精品乐播| 亚洲免费观看高清完整版在线观看熊 | 欧美r级在线观看| 亚洲免费色视频| 国产一区二区成人久久免费影院| 色综合婷婷久久| 精品久久久久久久久久久久久久久| 国产精品久久综合| 欧美日韩国产经典色站一区二区三区| 久久丝袜美腿综合| 亚洲va韩国va欧美va| 国产成人午夜视频| 91 com成人网| 综合亚洲深深色噜噜狠狠网站| 久久66热偷产精品| 欧洲一区二区av| 中文字幕欧美区| 精品在线亚洲视频| 欧美日韩不卡一区| 中文字幕一区在线| 国内外成人在线| 日韩一区二区三区在线视频| 亚洲一区二区三区四区中文字幕| 成人av在线资源| 国产欧美精品在线观看| 蜜桃av一区二区| 4hu四虎永久在线影院成人| 亚洲精品国产成人久久av盗摄| 成人免费视频免费观看| 久久久噜噜噜久久中文字幕色伊伊| 午夜精品福利一区二区三区av| 色婷婷精品久久二区二区蜜臀av| 中文av一区特黄| 成人一二三区视频| 久久久国产精华| 国产激情一区二区三区桃花岛亚洲| 日韩欧美国产一区二区三区| 三级欧美韩日大片在线看| 色综合久久中文综合久久牛| 中文字幕制服丝袜成人av| 国产大陆a不卡| 欧美精品一区二区不卡| 久久se精品一区精品二区| 欧美大片一区二区| 久久99精品久久久久久国产越南 | 成人丝袜视频网| 久久综合九色综合97婷婷| 免费看日韩a级影片| 日韩欧美一区二区视频| 免费观看一级特黄欧美大片| 欧美日韩精品一二三区| 亚洲成人你懂的| 欧美精品三级在线观看| 五月激情六月综合| 91精品在线免费| 激情六月婷婷综合| 久久一区二区视频| 国产成人免费在线观看不卡| 亚洲国产激情av| eeuss鲁片一区二区三区在线观看| 国产精品传媒入口麻豆| 99久久99久久综合| 一区二区久久久| 欧美猛男gaygay网站| 久久国产人妖系列| 国产亚洲欧美中文| 99久久久国产精品| 亚洲福利国产精品| 日韩你懂的在线播放| 国产乱码精品一区二区三区忘忧草| 国产午夜三级一区二区三| 成人久久18免费网站麻豆| 亚洲视频一区在线| 制服.丝袜.亚洲.中文.综合| 国内偷窥港台综合视频在线播放| 国产精品成人免费精品自在线观看| 91黄色小视频| 六月丁香婷婷久久|