• <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>
            http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html

            launching threads
            boost::thread類代表一個可執行的線程(thread of execution)。
            A new thread is launched by passing an object of a callable type that can be invoked with no parameters to the constructor.
            The object is then copied into internal storage, and invoked on the newly-created thread of execution.
            If you wish to construct an instance of boost::thread with a function or callable object that requires arguments to be supplied, this can be done using boost::bind.
            (thread non-copiable, but movable; object that used to created a thread must callable, if not, use boost::ref)

            Joining and detaching
            當代表一個可執行的線程(thread of execution)的boost::thread對象被銷毀時,這個線程便同時被detached. Detached的線程將繼續運行直到線程終止。
            也可以顯式調用(explicitly)一個boost::thread對象的detach()方法,這時這個線程直接被detach,而這個boost::thread對象講不再代表thread of execution,而指Not-a-Thread

            join()用于等待一個線程結束。
            (timed_join())

            Interruption
            調用boost::thread對象的interrupt()方法,可以中斷其對應的線程。
            When the interrupted thread next executes one of the specified interruption points (or if it is currently blocked whilst executing one) with interruption enabled, then a boost::thread_interrupted exception will be thrown in the interrupted thread. If not caught, this will cause the execution of the interrupted thread to terminate. As with any other exception, the stack will be unwound, and destructors for objects of automatic storage duration will be executed.
            (boost::this_thread::disable_interruption, Predefined Interruption Points)

            Thread IDs
            每一個運行中的thread都有一個唯一的id值。
            調用對應的boost::thread對象的get_id()方法,或者在運行的thread中調用boost::this_thread::get_id()方法。

            Namespace this_thread

            this_thread下包含的是在正在運行的線程內部,所能進行的線程操作,包括上面提到的get_id()方法
            http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html#thread.thread_management.this_thread

            Thread Group
            thread_group class provides for a collection of threads that are related in some fashion.
            New threads can be added to the group with add_thread and create_thread member functions.
            thread_group is not copyable or movable.


            posted on 2008-04-29 14:25 frank28_nfls 閱讀(790) 評論(0)  編輯 收藏 引用
             
            久久亚洲综合色一区二区三区| 狠狠色噜噜狠狠狠狠狠色综合久久 | 精品国产热久久久福利| 久久综合狠狠综合久久| 久久久综合九色合综国产| 久久久久国产亚洲AV麻豆| 久久久久久伊人高潮影院| 久久精品www| 久久精品国产99国产精品导航| 国内精品综合久久久40p| 日韩人妻无码精品久久久不卡| 久久精品中文字幕久久| 久久久久久久综合综合狠狠| 久久亚洲精品无码观看不卡| 久久综合亚洲欧美成人| 无码任你躁久久久久久| 久久被窝电影亚洲爽爽爽| 狠狠色婷婷久久综合频道日韩 | 亚洲精品NV久久久久久久久久| 一级女性全黄久久生活片免费| 久久久久av无码免费网| 久久久久国产成人精品亚洲午夜| 久久精品中文字幕一区 | 无码任你躁久久久久久老妇| 久久99国产综合精品女同| 四虎影视久久久免费| 国产精品99久久久久久董美香| 久久精品亚洲日本波多野结衣| 久久久无码精品亚洲日韩软件| 精品国产乱码久久久久久呢| 精品久久久久久国产三级| 亚洲一区二区三区日本久久九| 久久久国产精品亚洲一区| 一本色道久久99一综合| 中文字幕无码久久人妻| 亚洲欧美一级久久精品| 国产精品久久久久久久久久影院| 久久人人爽人人澡人人高潮AV| 亚洲综合婷婷久久| 青青草国产精品久久久久| 国产午夜免费高清久久影院|