Boost C++ Libraries: Ticket #16: way to defer thread creation needed https://svn.boost.org/trac10/ticket/16 <pre class="wiki">It is not now currently possible to defer boost thread creation to a later time without creating a wrapper class for the thread class. Starting a thread immediately in a constructor is not always desirable. Sometimes you require other members in your class to be initialized before the thread, for example. Or perhaps your class may have many threads that have to all be initialized before any of them can be created. I propose a new member function: thread::start(const function0&lt;void&gt;&amp; threadfunc) to accomplish this goal. To use this new function you could do something like: boost::thread thrd; // notice no function specified thrd.start(thread_alarm(secs)); or perhaps thread::start() could take no parameters and an new alternate thread constructor could be added that would not execute the thread right away: // thread class could have an enum { execute, defer } boost::thread thrd(thread_alarm(secs), boost::thread::defer); thrd.start(); The latter form has the advantage of the caller of start() need not being concerned with what function is being invoked. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/16 Trac 1.4.3 bill_kempf Sun, 06 Jan 2002 18:00:37 GMT status changed https://svn.boost.org/trac10/ticket/16#comment:1 https://svn.boost.org/trac10/ticket/16#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=180283 There's no need for this type of functionality since boost::thread has no need for delayed initialization of data. User data that needs to be delayed is already handled by the fact that the data and/or function object are seperate entities from the thread object. Further, the suggested syntax won't work since the default constructor is already used for a different purpose. If you don't understand how delayed initialization is already covered, please post a more specific question to the list. </pre> Ticket