Is thread active/alive? c++0x

Hi!
It is possible with c++0x established if a thread is active or alive?


I thought use the std::thread::get_id() but it's a good idea?


get_id() should raise an exception if I call it on a pointer std::thread that is no longer any thread?
You could try to join the thread.

Why do you need to know this?
Because I want to check how many threads are still active in my program.
closed account (3hM2Nwbp)
clros wrote:
Because I want to check how many threads are still active in my program.


For diagnostic purposes or to know in the release version? SysInternal's Process Explorer (Windows) is an excellent tool for process monitoring.

http://technet.microsoft.com/en-us/sysinternals/bb896653

PS:
I do not know of any Linux equivalents.
Under Linux, "ps -eLf" can tell you the number of threads.
Topic archived. No new replies allowed.