• <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无码久久不卡| 久久亚洲天堂| 一本一本久久a久久综合精品蜜桃| 99久久国产热无码精品免费久久久久| 一本一道久久综合狠狠老 | 狠狠精品久久久无码中文字幕| 伊人久久大香线蕉av不卡| 2021精品国产综合久久| 久久久久久久国产免费看| 色综合久久中文字幕无码| 久久国产视屏| 久久96国产精品久久久| 国内精品久久久久伊人av| 色天使久久综合网天天| 久久精品国产亚洲一区二区| 久久久久久久97| 国产一区二区精品久久岳 | 久久伊人精品青青草原高清| 午夜福利91久久福利| 99久久免费国产特黄| 亚洲AV无码久久寂寞少妇| 亚洲欧洲中文日韩久久AV乱码| 精品国产福利久久久| 久久久久亚洲AV成人片| 久久久久久精品免费免费自慰| 久久97久久97精品免视看| 久久发布国产伦子伦精品| 国内精品伊人久久久久妇| 国内精品久久久久久久久电影网| 久久精品人人做人人爽97 | 欧美亚洲另类久久综合婷婷| 夜夜亚洲天天久久| 国产欧美一区二区久久| 精品久久久久久亚洲| 99久久人妻无码精品系列蜜桃| 无码国内精品久久人妻| 欧美日韩精品久久免费| 99精品国产综合久久久久五月天| 亚洲中文字幕伊人久久无码| 亚洲v国产v天堂a无码久久| 亚洲欧美日韩精品久久亚洲区|