• <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 閱讀(792) 評論(0)  編輯 收藏 引用
             
            国内精品久久久久久野外| 人妻少妇精品久久| 久久亚洲AV成人无码国产| 品成人欧美大片久久国产欧美| 久久精品极品盛宴观看| 亚洲一本综合久久| 久久精品国产亚洲av麻豆色欲| 久久九色综合九色99伊人| 久久久久99精品成人片试看 | 欧美与黑人午夜性猛交久久久| 欧美国产精品久久高清| a级毛片无码兔费真人久久| 伊人久久大香线蕉精品不卡| 精品综合久久久久久88小说| 欧美伊香蕉久久综合类网站| 91精品国产乱码久久久久久 | 伊人色综合久久天天人守人婷| 人妻无码中文久久久久专区| 久久se这里只有精品| 精品无码久久久久国产动漫3d| 狠狠色丁香久久婷婷综| 精品久久久久久国产| 狠狠精品干练久久久无码中文字幕 | 久久人人妻人人爽人人爽| 久久久久久亚洲精品影院| 亚洲国产精品久久久久久| 国内精品九九久久久精品| 无码国内精品久久人妻蜜桃| 亚洲AV无码久久精品成人| 久久天天躁狠狠躁夜夜2020| 伊人久久免费视频| 久久99精品综合国产首页| 久久综合精品国产二区无码| 国产精品99久久久精品无码| 97久久精品无码一区二区天美| 久久久久久久波多野结衣高潮 | 伊人久久大香线蕉综合网站| 国内精品伊人久久久久网站| 日韩AV毛片精品久久久| 亚洲国产成人久久综合碰| 久久精品国产欧美日韩99热|