Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting thread info from sub-threads....problem solved



Thanks to everyone that helped. It seems everyone was right.

The GUI in question is launched via class loading and launching a method via invoke(). invoke() is called under a thread, but once it's launched that thread is dead, thus it doesn't show up in the list of threads, and it possibly never would have. Once the GUI is running it's completely on the EDT.

Thanks for the help guys!! :-)

Bill Wagner wrote:

In addition to what Shawn said at the bottom, the enumeration only records *active* threads.

Bill Wagner

Shawn Erickson wrote:

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




_______________________________________________ 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
References: 
 >Getting thread info from sub-threads. (From: bsd5tu1 <email@hidden>)
 >Re: Getting thread info from sub-threads. (From: "Shawn Erickson" <email@hidden>)
 >Re: Getting thread info from sub-threads. (From: Bill Wagner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.