• <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
            當代表一個可執(zhí)行的線程(thread of execution)的boost::thread對象被銷毀時,這個線程便同時被detached. Detached的線程將繼續(xù)運行直到線程終止。
            也可以顯式調用(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 閱讀(790) 評論(0)  編輯 收藏 引用
             
            久久综合欧美成人| 日韩欧美亚洲综合久久影院Ds | 久久久91人妻无码精品蜜桃HD| 久久中文精品无码中文字幕| 亚洲国产精品一区二区久久hs | 国产精品欧美久久久久无广告| 久久久久久国产精品美女| 色欲久久久天天天综合网| 国产69精品久久久久99| 久久午夜伦鲁片免费无码| 久久精品一区二区影院| 国产精品美女久久久久| 久久人人爽人人人人片av| 精品无码人妻久久久久久| 久久久亚洲欧洲日产国码二区| 人妻无码精品久久亚瑟影视| 老司机国内精品久久久久| 久久久久亚洲av无码专区喷水 | 国内精品综合久久久40p| 久久精品一区二区三区中文字幕| 69久久夜色精品国产69| 久久精品国产亚洲αv忘忧草| 久久青青草原精品国产软件| 99国产欧美精品久久久蜜芽| 日韩久久久久久中文人妻| 久久久国产亚洲精品| 内射无码专区久久亚洲| 久久免费大片| 久久久精品日本一区二区三区 | 狠狠人妻久久久久久综合蜜桃| 久久国产高潮流白浆免费观看| 一本久久知道综合久久| 久久精品国产免费观看| 久久精品国产亚洲AV蜜臀色欲| 久久久久免费精品国产| 漂亮人妻被中出中文字幕久久| 亚洲伊人久久综合中文成人网| 久久经典免费视频| 亚洲日本va中文字幕久久| 久久永久免费人妻精品下载| 俺来也俺去啦久久综合网|