This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in K&B SCJP 5: topic Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in K&B SCJP 5: topic Threads" Watch "Doubt in K&B SCJP 5: topic Threads" New topic
Author

Doubt in K&B SCJP 5: topic Threads

Paolo Dina
Ranch Hand

Joined: Aug 15, 2008
Posts: 63
Page 691, Waiting/Blocked/sleeping:
This is the state a thread is in when it's eligible to run
... and later...
the thread is still alive, but is currently not eligible to run.


Which one?


SCJP 5
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
what is your doubt ?


Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
Paolo Dina
Ranch Hand

Joined: Aug 15, 2008
Posts: 63
Based on the text I quoted above, when the state of a thread is waiting, blocked or sleeping, is the thread eligible to run?
Ankitt Gupta
Ranch Hand

Joined: Feb 19, 2009
Posts: 101
Paolo Dina wrote:Based on the text I quoted above, when the state of a thread is waiting, blocked or sleeping, is the thread eligible to run?


In the waiting state the thread is alive and after when the thread gets it's opportunity it again goes back to the runnable state.It doesn't mean that it be instantly be running.It schedule depends upon the scheduler.

The same is true for sleeping state.When the sleep time is up it again goes back to runnable state
Senthil Kumaran
Ranch Hand

Joined: Aug 24, 2008
Posts: 32
its a silly doubt ya, read once more the thread concepts given in K&B , if you cant understand then, post exact doubt.
Priyam Srivastava
Ranch Hand

Joined: Oct 29, 2006
Posts: 169
Senthil Kumaran wrote:its a silly doubt ya, read once more the thread concepts given in K&B , if you cant understand then, post exact doubt.


nothing is silly... it only lies in the eyes of the perceiver.


"History would be kind to me, for I intend to write it."
Senthil Kumaran
Ranch Hand

Joined: Aug 24, 2008
Posts: 32
i expected this sir, anyway i apologise sir,
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
Think about this in simple terms. In order for a thread to be eligible to run it must be in the runnable state. If it is in any other state it is not eligible to run.


All code in my posts, unless a source is explicitly mentioned, is my own.
 
GeeCON Prague 2014
 
subject: Doubt in K&B SCJP 5: topic Threads