$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Fwd: boost::thread and corresponding stack array
From: Igor R (boost.lists_at_[hidden])
Date: 2010-06-05 13:22:07
>Â Therefore, if you want an array of threads, you need to allocate each thread object
> individually on the heap, like:
>
> boost::thread* thr[SIZE];
> for (int i = 0; i < SIZE; ++i) thr[i] = new boost::thread(functor);
>
> Then of course, you need to iterate through the array later and call delete
> on each thread object.
Consider using thread_group: