Boost logo

Boost :

From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-05-10 07:35:43


the thread_group::create_thread takes a const function0<void> parameter:
    thread* create_thread(const function0<void>& threadfunc);

The function0 implies already a memory allocation. The templated version
look like:

    template <class Threadable>
    thread* thread_group::create_thread(Threadable threadfunc)
        // No scoped_lock required here since the only "shared data" that's
        // modified here occurs inside add_thread which does scoped_lock.
        std::auto_ptr<thread> thrd(new thread(threadfunc));
        return thrd.release();

Which works faster because no need to allocate memory for the

Anthony, if there is nothing wrong, could this substitute the create_thread
function in next Boost::thread release?

Best regards
Vicente Juan Botet Escriba

Boost list run by bdawes at, gregod at, cpdaniel at, john at