How to get the family tree of all the threads?

Tony Guan guanxiaohua at gmail.com
Wed Oct 28 20:54:21 PDT 2009


Hi,

I am working on a project where I need to identify the relations
between parent threads and children threads. Especially, I want to do
it inside the JVM, not in a java program.

Looking at the code of hotspot, I can only find the thread list inside
the Thread class, but it's not enough for my purpose.

Is there some way that I can draw out a family tree of the threads
within the hotspot? I know that from within a java program, we can
draw a tree of all the ThreadGroups, but it again is not what I want.

Or could you tell me how I could identify when a thread is created,
and who is the parental thread that creates it?

Thanks a lot!

Tony Guan


More information about the hotspot-dev mailing list