• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on Thread state

 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want know when a thread is said to be in running state.the follawing program prints "RUNNABLE" 10 times.But how can I get "RUNNING" by getState().

 
Daniel Del Moral
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the API:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.State.html

There is no RUNNING state in the class Thread.State. That might be because it doesn't make sense to add this state. Think about it, if getState() is been executed, then you are running the Thread. If you make a difference in the Thread.State between running and runnable, you won't ever print runnable, because it would mean you're not executing it right now.
 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Daniel for Excellent !!! explanation, now I got it.

I am preparing for SCJP 6 and you have great score on SCJP(97%) ,so would you send your study notes and materials when you are preparing for the SCJP and Thanks... waiting.....
 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SORRY!!! i am forgotting my e-mail ID-ashokpradhan_61@yahoo.com
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ashok Pradhan:
thanks Daniel for Excellent !!! explanation, now I got it.

I am preparing for SCJP 6 and you have great score on SCJP(97%) ,so would you send your study notes and materials when you are preparing for the SCJP and Thanks... waiting.....


I am sure Daniel will be kind enough to post any information he has right here at the ranch so everyone can benefit.

Is there any reason it has to be sent only through email ? A score is more reflective of a person's preparation and understanding of the subject than what they used to study the subject. Just my thoughts
 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John.
No there is not such specific reason for sending in e-mail but it depends upon Daniel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic