Boost logo

Boost Users :

Subject: Re: [Boost-users] Thread status
From: Jens Luedicke (jens.luedicke_at_[hidden])
Date: 2009-01-30 15:21:57


Zeljko Vrba wrote:
> On Fri, Jan 30, 2009 at 02:06:09PM +0000, Jens Luedicke wrote:
>> how can I check if a given thread is runinng/finished/sleeping?
>>
> You can't. Even if you could, the information will most probably be wrong
> by the time you get to use it. What is the actual problem you're trying to
> solve?
>

I have three threads. Two of them are independent and they can run in
parallel. The third thread depends on results returned by the first and
second threads.

Right now I use a condition variable to wait in the third thread until
the first and second threads are finished (by checking two boolean
variables that are set to true once the first and second threads
finish).

In a later scenario I may need to query those threads anytime to suspend
or terminate them (the threads will run trajectory computations for a
helicopter: takeoff, approach and cross-country flight).

I was wondering if there is a boost-way to obtain state informations
about a thread.

Jens

-- 
Jens Luedicke
web: http://perldude.de

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net