Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2005

Tip: Looking for answers? Try searching our database.

how to get threadName from threadID?

Thread view: 
dtliu_04@hotmail.com - 07 Mar 2005 09:21 GMT
Hi,

I would like to get a threadName from a threadID. I would like
something like "getThreadNameFromThreadID" in the line here:

String threadName = System.getThreadNameFromThreadID(long threadID);

It doesn't seem like this is available in java 1.4.2.  Any suggestions?
Thomas Schodt - 07 Mar 2005 10:18 GMT
> I would like to get a threadName from a threadID. I would like
> something like "getThreadNameFromThreadID" in the line here:
>
> String threadName = System.getThreadNameFromThreadID(long threadID);

What is threadID?

If you can get the Thread instance from the threadID
you can use Thread.getName()
Chris Smith - 07 Mar 2005 14:34 GMT
> I would like to get a threadName from a threadID. I would like
> something like "getThreadNameFromThreadID" in the line here:
>
> String threadName = System.getThreadNameFromThreadID(long threadID);
>
> It doesn't seem like this is available in java 1.4.2.  Any suggestions?

Threads do not have any assigned numerical ID numbers in Java.  Where
did you get threadID from, and what is it?

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Tor Iver Wilhelmsen - 07 Mar 2005 16:01 GMT
> String threadName = System.getThreadNameFromThreadID(long threadID);

What kind of "System" class is this? There is no such method in
java.lang.System, not even in 1.5.x.
Dotty - 07 Mar 2005 19:19 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> It doesn't seem like this is available in java 1.4.2.  Any suggestions?

String tcurrent = Thread.currentThread().getName();


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.