锘??xml version="1.0" encoding="utf-8" standalone="yes"?>一97日本道伊人久久综合影院,久久久久久亚洲精品成人 ,久久国产成人午夜AV影院http://www.shnenglu.com/byc/category/15470.htmlzh-cnMon, 15 Nov 2010 20:25:33 GMTMon, 15 Nov 2010 20:25:33 GMT60pthreads-w32http://www.shnenglu.com/byc/archive/2010/11/15/133666.html鍏彾鑽?/dc:creator>鍏彾鑽?/author>Mon, 15 Nov 2010 07:41:00 GMThttp://www.shnenglu.com/byc/archive/2010/11/15/133666.htmlhttp://www.shnenglu.com/byc/comments/133666.htmlhttp://www.shnenglu.com/byc/archive/2010/11/15/133666.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/133666.htmlhttp://www.shnenglu.com/byc/services/trackbacks/133666.htmlhttp://shenan1984.blog.163.com/blog/static/2530851020098231001787/
  official site: http://sourceware.org/pthreads-win32/
  source code: ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz

1. 緙栬瘧:
    铏界劧婧愮爜鍖呴噷鎻愪緵浜唙c6鐨勯」鐩枃浠? 浣嗘槸鎵撲笉寮鐨? 鍙兘鐢╪make. 榛樿鐨勪細鍛婅瘔浣犱竴鍫唍make鍙傛暟鐨?
    鎴戞墍瑕佺敤鐨勬槸緙栬瘧鎴恠tatic鐨刲ibrary, 鎵浠ヨ緭鍏?nmake clean VC-static", 緙栬瘧寰堝揩鐨? 涓嶈繃榛樿浼氶摼鎺ュ埌VC鐨刢rt, 鎴戜滑闇瑕佷慨鏀瑰畠鐨刴akefile. 鎵懼埌CFLAGS閭d竴琛? 鎶?/MD"鏀規垚"/MT".

2. 欏圭洰:
    璇?. 鏈夊ソ澶氬湴鏂硅鏀圭殑.
    a) 褰撶劧鏄痸s璺緞鐨刬nclude鍟? lib鍟?. 鑷繁鍔?
    b) 欏圭洰鐨刢rt璁劇疆鎴?/MT"鍜?/MTd". 棰濆鐨刲ib鍔? pthreadVC2(d).lib ws2_32.lib
    c) preprocesser瀹氫箟鐨勫湴鏂? 鍔犱竴涓?#8220;PTW32_STATIC_LIB”瀹? 涓嶇劧link鐨勬椂鍊欎細鎵句笉鍒皊ymbol鐨?
    d) 濂戒簡, 浣犲彲浠oding浜? 闅忎究pthread_create()涓鎶婂惂.

3. 緙栫爜:
    鍡棷.. 濡傛灉鐪熺殑鐩存帴pthread_create()鐨勮瘽鍙槸浼歛ccess violation鐨勫憖. win32涓嬬殑綰跨▼寰堣寮傜殑, 鍍弚insock涓鏍? 璋冪敤浠諱綍鍏跺畠鍑芥暟涔嬪墠蹇呴』璋冪敤pthread_win32_process_attach_np(), 緇撴潫鍚庡繀欏昏皟鐢╬thread_win32_process_detach_np(). 浠g爜澶ф灝辨槸榪欐牱鐨?

1. 涓嬭澆pthreads win32婧愪唬鐮侊細
    ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz
2. 緙栬瘧闈欐佸簱錛?br>make clean GC-static
鍦ㄦ牴鐩綍涓嬮潰鐢熸垚libpthreadGC2.a
3. 灝嗙敓鎴愮殑libpthreadGC2.a鎷瘋礉鍒癿ingw搴撶洰褰曚笅錛屽皢pthread.h, sched.h, semaphore.h鎷瘋礉鍒癐NCLUDE鐩綍涓?br>4. 浣跨敤libpthread搴擄紝
鍦ㄧ▼搴忚搗濮嬪瀵筶ibpthread浣滃垵濮嬪寲錛?br>#if defined(PTW32_STATIC_LIB)
    ptw32_processInitialize();
#endif
5. 緙栬瘧鏃剁‘淇濅紶鍏?DPTW32_STATIC_LIB錛岄摼鎺ユ椂鍔犲叆-lpthreadGC2錛?OK錛?br>

http://hi.baidu.com/lff0305/blog/item/2a55e7366ebba6360b55a942.html
pthread2鎻愪緵浜嗕笉鍚岀殑.lib浠ュ強鐩稿搴旂殑.dll,

pthread[VG]{SE,CE,C}c.dll
pthread[VG]{SE,CE,C}c.lib

 

鍚箟涓?br>[VG] 緙栬瘧鍣ㄧ綾?br>V    - MS VC, or
G    - GNU C

 

{SE,CE,C} 寮傚父澶勭悊妯″紡
SE    - Structured EH, or
CE    - C++ EH, or
C    - no exceptions - uses setjmp/longjmp

c    - DLL compatibility number indicating ABI and API
compatibility with applications built against
any snapshot with the same compatibility number.
See 'Version numbering' below.

   姣斿涓婇潰鐢ㄧ殑pthreadvc2.dll, 鍚箟涓?

   v = MSVC

   c = 娌℃湁浣跨敤寮傚父鏈哄埗, 鑰屾槸浣跨敤setjump/longjmp

   2 = 鍏肩敤鎬?- 鍜宲thread2鍏煎, 涓嶅拰鏃х増鏈琾thread1鍏煎.

 

   璇︾粏璇峰弬鐓thread鐨剅eadme.


http://blog.csdn.net/psusong/archive/2010/01/14/5189659.aspx

pthread 闈欐佺紪璇戠増鏈湪Windows涓嬩嬌鐢ㄦ椂鐨勬敞鎰忎簨欏?
浣滀負閫氱敤鐨勮法騫沖彴楂樻ц兘綰跨▼搴擄紝鍦ㄥ緢澶氳法騫沖彴鐨勯」鐩腑閮藉彲浠ョ湅瑙乸thread鐨勮韓褰便俻thread鏈韓鐨勫疄鐜版瘮杈冧紭闆咃紝APIs浣跨敤璧鋒潵涔熷緢鏂逛究銆?/p>

浣嗗湪Windows涓嬩嬌鐢ㄩ潤鎬佺紪璇戠殑pthread鏃惰鐗瑰埆娉ㄦ剰涓涓嬶紝蹇呴』鏄懼紡鐨勮皟鐢ㄥ涓嬪洓涓嚱鏁幫紝鍚﹀垯pthread鐢ㄥ埌鐨勪竴浜涘叏灞鍙橀噺浼氭病鏈夎鍒濆鍖栵紝瀵艱嚧鎵鏈夌殑pthread鐨凙PIs璋冪敤閮絚rash.

BOOL pthread_win32_process_attach_np (void);

BOOL pthread_win32_process_detach_np (void);

BOOL pthread_win32_thread_attach_np (void);

BOOL pthread_win32_thread_detach_np (void);

pthread瀹樻柟鏂囨。瀵規鏈夊涓嬬殑鏄庣‘璇存槑錛?/p>

These functions contain the code normally run via dllMain

when the library is used as a dll but which need to be

called explicitly by an application when the library

is statically linked.

You will need to call pthread_win32_process_attach_np() before

you can call any pthread routines when statically linking.

You should call pthread_win32_process_detach_np() before

exiting your application to clean up.

pthread_win32_thread_attach_np() is currently a no-op, but

pthread_win32_thread_detach_np() is needed to clean up

the implicit pthread handle that is allocated to a Win32 thread if

it calls certain pthreads routines. Call this routine when the

Win32 thread exits.

These functions invariably return TRUE except for

pthread_win32_process_attach_np() which will return FALSE

if pthreads-win32 initialisation fails.

閫氳繃鍑芥暟鐨勫悕瀛楁垜浠笉闅劇寽嫻嬪嚭濡備笅璋冪敤欏哄簭

鍦ㄧ▼搴忓紑濮嬬殑鏃跺欒璋冪敤錛?/p>

BOOL pthread_win32_process_attach_np (void);

BOOL pthread_win32_thread_attach_np (void);

鍦ㄧ▼搴忛鍑烘椂瑕佽皟鐢細

BOOL pthread_win32_thread_detach_np (void);

BOOL pthread_win32_process_detach_np (void);

姣旇緝閫氱敤鐨勫仛娉曟槸鍦ㄦā鍧桳oad鍜孶nLoad鐨勬椂鍊欏仛榪欎釜attach鍜宒etach鎿嶄綔錛屽涓嬮潰鎵紺猴細

/* Callback for our DLL so we can initialize pthread */

BOOL WINAPI DllMain( HANDLE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )

{

#ifdef PTW32_STATIC_LIB

    switch( fdwReason )

    {

        case DLL_PROCESS_ATTACH:

            pthread_win32_process_attach_np();

        case DLL_THREAD_ATTACH:

            pthread_win32_thread_attach_np();

            break;

        case DLL_THREAD_DETACH:

            pthread_win32_thread_detach_np();

            break;

        case DLL_PROCESS_DETACH:

            pthread_win32_thread_detach_np();

            pthread_win32_process_detach_np();

            break;

    }

#endif

    return TRUE;

}

娉ㄦ剰錛?PTW32_STATIC_LIB 瀹忎負pthread闈欐佺紪璇戠殑鏍囧織錛岃繖涓彲浠ラ氳繃pthread.h鐨勯厤緗垨鑰匔FLAGS浼犻掕繘鏉ャ?br>涓嬮潰鏄痯thread鐨勫畼鏂圭殑dll.c鐨勫疄鐜?br>BOOL WINAPI
DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
{
  BOOL result = PTW32_TRUE;
  switch (fdwReason)
    {
    case DLL_PROCESS_ATTACH:
      result = pthread_win32_process_attach_np ();
      break;
    case DLL_THREAD_ATTACH:
      /*
       * A thread is being created
       */
      result = pthread_win32_thread_attach_np ();
      break;
    case DLL_THREAD_DETACH:
      /*
       * A thread is exiting cleanly
       */
      result = pthread_win32_thread_detach_np ();
      break;
    case DLL_PROCESS_DETACH:
      (void) pthread_win32_thread_detach_np ();
      result = pthread_win32_process_detach_np ();
      break;
    }
  return (result);
} /* DllMain */
涔熷氨鏄pthread瀹樻柟浠g爜鍦ㄥ姩鎬佺紪璇戠殑鐗堟湰涓富鍔ㄥ仛浜嗚繖涓猘ttach鍜宒etach鎿嶄綔銆?br>鑰岄潤鎬佺紪璇戠増鏈敱浜庢病鏈変竴涓悎閫傜殑鍦版柟鏉ュ仛榪欎歡浜嬶紝灝卞皢attach鍜宒etach鐨勭殑鎿嶄綔鎵旂粰鐢ㄦ埛鏉ュ畬鎴愪簡銆?br>涓婇潰鐨勪唬鐮佹槸閽堝璋冪敤鏂規槸Dll鐨勬儏鍐靛仛鐨勫垵濮嬪寲錛屽鏋滆皟鐢ㄦ柟涓嶆槸Dll鍛紵瀵規鍙互鍙傜収濡備笅鍋氭硶錛岃櫧鐒跺緢鏆村姏錛屼絾寰堢畝鍗曪紝鍙互宸ヤ綔
1錛夊畾涔夊涓嬪嚱鏁?br>#ifdef PTW32_STATIC_LIB
static void detach_ptw32(void)
{
    pthread_win32_thread_detach_np();
    pthread_win32_process_detach_np();
}
#endif
2錛夊湪浣犵殑涓葷▼搴忕殑鍏ュ彛澶勶紝涓鑸岃█鏄痬ain()涓仛濡備笅璋冪敤鍗沖彲
#ifdef PTW32_STATIC_LIB
    pthread_win32_process_attach_np();
    pthread_win32_thread_attach_np();
    atexit(detach_ptw32);
#endif
 
涔熷氨鏄敤atexit()灝哾etach宸ヤ綔鎸傛帴鍒扮▼搴忎腑鍘伙紝浣垮緱紼嬪簭鍦ㄩ鍑虹殑鏃跺欏彲浠ュpthread榪涜detach.



]]>
天天躁日日躁狠狠久久 | 中文精品久久久久国产网址| 热RE99久久精品国产66热| 久久青草国产精品一区| 久久婷婷五月综合国产尤物app| 久久99精品久久久久久秒播| 欧美一区二区精品久久| 久久久综合九色合综国产| 色综合合久久天天综合绕视看| 国产精品美女久久久久网| 好久久免费视频高清| 亚洲午夜久久影院| 麻豆国内精品久久久久久| 中文成人久久久久影院免费观看| 久久久久亚洲国产| A级毛片无码久久精品免费| 久久精品国产2020| 99久久99这里只有免费的精品| 亚洲成人精品久久| 亚洲日本va午夜中文字幕久久| 国产精品久久久久蜜芽| 国产亚洲美女精品久久久久狼| 99久久精品免费观看国产| 久久国产AVJUST麻豆| 久久免费的精品国产V∧| 精品久久久无码中文字幕| 国产精品欧美久久久天天影视| 999久久久国产精品| 亚洲一区精品伊人久久伊人| 久久综合九色综合网站| 久久99精品国产麻豆不卡| 久久精品国产亚洲av麻豆图片| 久久本道伊人久久| 一日本道伊人久久综合影| AV无码久久久久不卡网站下载| 欧美久久久久久精选9999| 日日噜噜夜夜狠狠久久丁香五月 | 看全色黄大色大片免费久久久 | 亚洲国产婷婷香蕉久久久久久| 亚洲中文精品久久久久久不卡| 国产99久久精品一区二区|