Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > [Thread[pool-1-thread-2,5,main] - What does this mean?

Reply
Thread Tools

[Thread[pool-1-thread-2,5,main] - What does this mean?

 
 
Hugo
Guest
Posts: n/a
 
      03-26-2008
I would like to check concurrency issues in java web application; like
all developers I did a System.out.println on the current thread:
[Thread[pool-1-thread-8,5,main]

Can anyone help me understand what the values in the system.out are?

I am assuming that:
1: Is the thread pool number
8: Is the thread number
5: I have no clue.

Are my assumptions correct above?
 
Reply With Quote
 
 
 
 
Daniel
Guest
Posts: n/a
 
      03-26-2008
the third could be method that the thread are running.
your assumptions seems good. but I can't answer with 100% certainty.


On 26 Mar, 01:45, Hugo <(E-Mail Removed)> wrote:
> I would like to check concurrency issues in java web application; like
> all developers I did a System.out.println on the current thread:
> [Thread[pool-1-thread-8,5,main]
>
> Can anyone help me understand what the values in the system.out are?
>
> I am assuming that:
> 1: Is the thread pool number
> 8: Is the thread number
> 5: I have no clue.
>
> Are my assumptions correct above?


 
Reply With Quote
 
 
 
 
John Maline
Guest
Posts: n/a
 
      03-26-2008
Hugo wrote:
> I did a System.out.println on the current thread:
> [Thread[pool-1-thread-8,5,main]
>
> Can anyone help me understand what the values in the system.out are?


What you're seeing is the output of Thread.getName(). Set with
Thread.setName() or the Thread constructor.

So it could be anything, depending on what the web app container does.
It's not specified by the Java language. Talk to the developer of the
web app container.
 
Reply With Quote
 
Joshua Cranmer
Guest
Posts: n/a
 
      03-26-2008
Hugo wrote:
> I would like to check concurrency issues in java web application; like
> all developers I did a System.out.println on the current thread:
> [Thread[pool-1-thread-8,5,main]
>
> Can anyone help me understand what the values in the system.out are?


I'm guessing that it is the following:
Simple class name (e.g., Thread)
pool number (1)
thread number (
priority (5, or Thread.DEFAULT_PRIORITY)
thread name (main)


--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
 
Reply With Quote
 
Logan Shaw
Guest
Posts: n/a
 
      03-27-2008
Hugo wrote:
> I would like to check concurrency issues in java web application; like
> all developers I did a System.out.println on the current thread:
> [Thread[pool-1-thread-8,5,main]
>
> Can anyone help me understand what the values in the system.out are?
>
> I am assuming that:
> 1: Is the thread pool number
> 8: Is the thread number
> 5: I have no clue.
>
> Are my assumptions correct above?


As others have said, I don't think there's any spec about this, so
there's no way to be sure without knowing specific details of the
system you're on.

However, I will say this: when I write a toString() method, I often
include in the output some information which can also be retrieved
by getWhatever() methods. Are there are any getWhatever() methods
on Thread that would possibly return an integer with a value of 5?
It turns out Thread.getId() and Thread.getPriority() both return
integer values. And Thread.getState() returns an enum, which could
map to a small integral value. I would try printing out all of
those alongside your toString() output and seeing if one of them
mysteriously happens to always correspond to what you see between
the first and second comma in the toString() output.

- Logan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET 2.0 ASPx Page does not load, but HTM does prabhupr@hotmail.com ASP .Net 1 02-08-2006 12:57 PM
Button OnClick does not fire on first postback, but does on second Janet Collins ASP .Net 0 01-13-2006 10:08 PM
Does the 2.0 Framework come out when Visual Studio .NET 2005 does? needin4mation@gmail.com ASP .Net 3 10-07-2005 12:55 AM
CS0234 Global does not exist ... but it genuinely does Bill Johnson ASP .Net 0 07-08-2005 06:34 PM
Does no one else think microsoft does a poor job? =?Utf-8?B?SmVyZW15IEx1bmRncmVu?= Wireless Networking 2 11-20-2004 12:17 AM



Advertisments