• <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類代表一個(gè)可執(zhí)行的線程(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
            當(dāng)代表一個(gè)可執(zhí)行的線程(thread of execution)的boost::thread對象被銷毀時(shí),這個(gè)線程便同時(shí)被detached. Detached的線程將繼續(xù)運(yùn)行直到線程終止。
            也可以顯式調(diào)用(explicitly)一個(gè)boost::thread對象的detach()方法,這時(shí)這個(gè)線程直接被detach,而這個(gè)boost::thread對象講不再代表thread of execution,而指Not-a-Thread

            join()用于等待一個(gè)線程結(jié)束。
            (timed_join())

            Interruption
            調(diào)用boost::thread對象的interrupt()方法,可以中斷其對應(yīng)的線程。
            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
            每一個(gè)運(yùn)行中的thread都有一個(gè)唯一的id值。
            調(diào)用對應(yīng)的boost::thread對象的get_id()方法,或者在運(yùn)行的thread中調(diào)用boost::this_thread::get_id()方法。

            Namespace this_thread

            this_thread下包含的是在正在運(yùn)行的線程內(nèi)部,所能進(jìn)行的線程操作,包括上面提到的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)  編輯 收藏 引用

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


             
            久久精品青青草原伊人| 久久国产高清字幕中文| 四虎国产精品免费久久久| 国产香蕉97碰碰久久人人| 精品久久久无码中文字幕| 精品久久久久久无码人妻蜜桃| 久久中文精品无码中文字幕| 久久精品水蜜桃av综合天堂| 久久99精品久久久久久不卡 | 亚洲Av无码国产情品久久| 国产成人精品久久| 美女写真久久影院| 一本色综合久久| Xx性欧美肥妇精品久久久久久| 久久久精品国产免大香伊| 久久99精品国产99久久6男男| 亚洲精品无码专区久久同性男| 久久精品黄AA片一区二区三区| 四虎亚洲国产成人久久精品| 国产人久久人人人人爽| 亚洲αv久久久噜噜噜噜噜| 久久综合亚洲鲁鲁五月天| 性高朝久久久久久久久久| 久久国产乱子精品免费女| 久久精品国产日本波多野结衣| 久久精品无码免费不卡| 久久久久综合国产欧美一区二区 | 国产精品18久久久久久vr| 久久久精品人妻一区二区三区四| 久久久精品人妻无码专区不卡| 99久久无色码中文字幕| 久久亚洲欧美国产精品| 久久久精品人妻一区二区三区蜜桃 | 欧美精品丝袜久久久中文字幕| 亚洲国产成人久久综合碰碰动漫3d | 久久99精品久久久久久| 99久久免费国产精精品| 国产欧美一区二区久久| 国内精品久久久久久野外| 久久综合丝袜日本网| 国产综合免费精品久久久|