Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Threads - Get running threads

Reply
Thread Tools

Java Threads - Get running threads

 
 
Pedro Pinto
Guest
Posts: n/a
 
      04-08-2008
Hy there,

I'm building an application that creates a thread. This thread creates
other threads to perform several tasks.

My question is simple. Being this main thread created in a JSP page,
and still running after the user logs out, how can i get the current
status of the thread? I would like for the user, when he logs on the
application, to verify if the thread is active, that is, the current
status.

I can't seem to be able to get the thread once it is initialized.

Thanks in advance for any help.

Regards

Pedro Pinto
 
Reply With Quote
 
 
 
 
Hugo
Guest
Posts: n/a
 
      04-08-2008
On Apr 8, 2:42 am, Pedro Pinto <(E-Mail Removed)> wrote:
> Hy there,
>
> I'm building an application that creates a thread. This thread creates
> other threads to perform several tasks.
>
> My question is simple. Being this main thread created in a JSP page,
> and still running after the user logs out, how can i get the current
> status of the thread? I would like for the user, when he logs on the
> application, to verify if the thread is active, that is, the current
> status.
>
> I can't seem to be able to get the thread once it is initialized.
>
> Thanks in advance for any help.
>
> Regards
>
> Pedro Pinto


Hi Pedro:

I am not sure if I completely understand your questions.

Examples of thread details that can be listed are:

Thread.getName(), Thread.isAlive() etc; further info at:
http://java.sun.com/j2se/1.5.0/docs/...ng/Thread.html

Why do you want to show the use the status of the thread?
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-08-2008
Pedro Pinto wrote:
> I'm building an application that creates a thread. This thread creates
> other threads to perform several tasks.
>
> My question is simple. Being this main thread created in a JSP page,
> and still running after the user logs out, how can i get the current
> status of the thread? I would like for the user, when he logs on the
> application, to verify if the thread is active, that is, the current
> status.
>
> I can't seem to be able to get the thread once it is initialized.


You need to store a reference to the thread somewhere.

Like saving it in application with username as key.

BTW, it is very bad practice to have JSP pages start threads.

Arne
 
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
get number of threads from a running process Skellington Ruby 1 12-11-2012 10:34 PM
When a Java program starts up, several system threads are also started ... Is this why all Java classes have extra synchronization overhead ... Casey Hawthorne Java 1 10-27-2006 09:39 AM
need example of multi-threaded java pgm - enables all threads to get items johndesp@us.ibm.com Java 9 01-12-2005 02:16 AM
java Bug? -> Java threads: Wait X Notify X [Thread AGAINST Runnable] Renato Battaglia Java 3 10-24-2003 04:54 PM



Advertisments