$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Determining thread existence
From: Nigel Rantor (wiggly_at_[hidden])
Date: 2009-04-08 14:04:32
Jeremy Rottman wrote:
> What I am trying to do is remove threads from the thread group after
> they have run. So that when my daemon iterates it will start new threads
> if none exist.
Okay, it sounds to me as if you are confusing the thread's existence
with its state.
Just because a thread has completed its task and is no longer running
does not mean it does not exist, there is still a C++ object on the heap
that holds some state, and this object is still referenced by the
thread_group.
If you want threads to be removes from the thread group once they have
completed their task you will have to do this yourself, the thread_group
class doesn't provide this for you.
The way in which you go about keeping track of the threads will really
depend on what you're doing with them.
Regards,
Nige