• <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 閱讀(787) 評論(0)  編輯 收藏 引用
             
            99久久精品免费看国产一区二区三区 | 国产一区二区三区久久| 97久久国产亚洲精品超碰热| 青青草原精品99久久精品66| 久久九九有精品国产23百花影院| 国产精品99久久久久久www| 久久国产AVJUST麻豆| 狠色狠色狠狠色综合久久| 国产成人精品久久一区二区三区av| 久久精品国产一区二区| 97精品依人久久久大香线蕉97| 久久婷婷国产综合精品| 久久久久亚洲AV成人网| 亚洲国产精品无码久久一线| 亚洲国产精品久久久久婷婷软件| 一本久久免费视频| 99久久国产综合精品五月天喷水| 久久九九兔免费精品6| 久久99精品国产麻豆婷婷| 热re99久久6国产精品免费| 久久精品国产一区二区| 国产亚洲精久久久久久无码| 久久久无码精品亚洲日韩京东传媒 | 久久99国产精品尤物| 人妻少妇精品久久| 久久免费视频观看| 国产日产久久高清欧美一区| 久久久久久国产精品无码下载| 国内精品久久久久影院网站| 久久成人精品视频| 久久综合综合久久97色| 国产精品毛片久久久久久久| 久久久久99精品成人片欧美| 麻豆av久久av盛宴av| 国产免费久久精品99re丫y| 亚洲精品NV久久久久久久久久| 国产综合成人久久大片91| 国产999精品久久久久久| 国产精品热久久无码av| 久久精品中文字幕有码| 无码任你躁久久久久久久|