This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes newly created thread state? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "newly created thread state?" Watch "newly created thread state?" New topic
Author

newly created thread state?

Shrinath M Aithal
Ranch Hand

Joined: May 20, 2009
Posts: 82
source : http://www.santis.ch/training/java/jcp/selftester

exact question is this :
what is the initial state of a new created and started thread?

and options are :
1. New
2. Not Runnable
3. Ready
4. Running
5. Dead

I selected Running because I saw the word "started" in the question.. that means start() was called.. did I interpret it wrong? Anyone else feels question is not so clear ?

Regards
Shri..

SCJP 5.0
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

What are we supposed to do? What do you expect from us, the ranchers?
Please be kind enough to post the code!


Regards, Sud.
SCJP 5 ScjpFAQ JLS
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.

cheers
Bob


SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Shrinath M Aithal
Ranch Hand

Joined: May 20, 2009
Posts: 82
sudipto shekhar wrote:What are we supposed to do? What do you expect from us, the ranchers?


1. I asked the ranchers, did I interpret the question wrong ?

sudipto shekhar wrote: Please be kind enough to post the code!


2. I asked you the exact question and I have given the link to the source.. there is no code for it... it is a "question" if you didn't notice.. and there are 5 choices, I selected one of them and the mock test told me I was wrong.. So I asked, " Did I interpret it wrong ? "

Sorry, I dont understand why you were mad at me..
Shrinath M Aithal
Ranch Hand

Joined: May 20, 2009
Posts: 82
Bob Wheeler wrote:If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.



Runnable means "Ready" here ? So it is not yet running?
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Shrinath M Aithal wrote:
Bob Wheeler wrote:If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.



Runnable means "Ready" here ? So it is not yet running?

I guess so. But I have never heard of this status. I don't know on what basis this test is done.
Runnable means, the thread is "ready" to start. The thread can come back to this status after waiting/blocking. I just don't like to give this status a different name.
If you get a question like this in the exam, they'll use the term "Runnable".
To answer your question: yes.

cheers
Bob
Shrinath M Aithal
Ranch Hand

Joined: May 20, 2009
Posts: 82
ok Bob.. thank you seems like a lot of things are wrong with this test.. if you open the scjp mock tests page in ranch, it is the third one, which opens up a german site..

there are misleading answers too.. like the test says + is not overloaded in wrapper classes..
So no worries..
thank you
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Shrinath M Aithal wrote:ok Bob.. thank you seems like a lot of things are wrong with this test.. if you open the scjp mock tests page in ranch, it is the third one, which opens up a german site..

there are misleading answers too.. like the test says + is not overloaded in wrapper classes..
So no worries..
thank you

No prob.
I didn't use them. I used examLab (5 exams altogether) and the K&B stuff (2 exams+1). First of all I would use them. I really liked them
The examLab was really tough, but afterwards you know where you have to invest some time.

Have Fun and cheers
Bob
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 818

Shrinath M Aithal wrote:
Bob Wheeler wrote:If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.



Runnable means "Ready" here ? So it is not yet running?



Runnable means it is ready to run. to be more precise, it means that the process is ready to execute but is not yet scheduled by the processor to run. Running means that the process is currently being executed..
When the thread is popped back to runnable that means again the thread is ready to run but is not running. yes when the start() is invoked that means the thread is ready to run but is not scheduled by the scheduler to run...Which thread is scheduled at what time completely depends on the scheduler and the scheduling algorithm that is being used by the system....

Hope this helps....
 
wood burning stoves
 
subject: newly created thread state?
 
Similar Threads
Thread,Join problem
Closing the database.
Terminating the server
Threads execution is disorder
Preempting the main thread