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

            join()用于等待一個線程結(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
            每一個運(yùn)行中的thread都有一個唯一的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)  編輯 收藏 引用
             
            日韩精品久久久久久| 亚洲综合日韩久久成人AV| 久久se精品一区二区| 久久精品成人免费看| 精品水蜜桃久久久久久久| 久久夜色撩人精品国产| 思思久久好好热精品国产| 久久99精品国产| 久久精品综合网| 88久久精品无码一区二区毛片 | 国产精品久久久久久久久| 久久精品国内一区二区三区| 亚洲国产成人精品无码久久久久久综合| 三级三级久久三级久久 | 精品久久久久久国产牛牛app| 久久免费视频1| 99热成人精品免费久久| 欧美一区二区三区久久综| 久久综合亚洲色HEZYO社区| 久久91这里精品国产2020| 色婷婷综合久久久久中文一区二区| 久久天天日天天操综合伊人av| 一本大道久久a久久精品综合| 久久棈精品久久久久久噜噜| 久久久99精品成人片中文字幕| 26uuu久久五月天| 国产激情久久久久久熟女老人 | 久久九九久精品国产免费直播| 久久国产亚洲精品无码| 久久久久99这里有精品10 | 亚洲午夜久久影院| 国产精品免费福利久久| 国产情侣久久久久aⅴ免费| 亚洲色婷婷综合久久| 午夜精品久久久久久中宇| 久久久久久曰本AV免费免费| 日韩中文久久| 久久久久亚洲国产| 99久久久精品免费观看国产| 日韩乱码人妻无码中文字幕久久| 久久久久亚洲AV无码麻豆|