On 8/20/06, bsd5tu1 <email@hidden> wrote:
If the method we launch creates another thread within it, I would like
to be able to list that thread and any other threads it may launch as
well. I assumed that if we used the same code from withing the thread
launched in the loaded class/launched method it would produce a list of
more threads....namely all the threads etc it has generated itself PLUS
all of those above. Instead what we get is the exact same list.
Does anyone know why this is ? Would it possibly be caused by the fact
the method is static? Also, does anyone know if there is a way that the
method that loads the class and launches the method can "parse into"
the
newly launched method and obtain a list of all it's threads without
putting any of this thread listing code into the method?
The thread enumeration API only allows you to enumerate all thread in
the VM and/or in a given thread group... Anyway the connection between
a thread and the thread that started it is ethereal and not tracked by
the Java runtime. If you want to track this type of information you
will have to use Thread subclass or some such thing to maintain a
record of the thread that called start.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden