• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question from threads.

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,



This is one of the question from dan's mock,I'am just confused what actually Not-Runnable term means...
I didn't find the term anywhere in K&B book,just wondered what kind of state is Not-Runnable...and when does any thread reaches this state?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Thread is "not-runnable" if it is sleeping, waiting, or blocked.

SOURCE: http://java.sun.com/docs/books/tutorial/essential/threads/lifecycle.html
[ September 16, 2004: Message edited by: marc weber ]
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ... Just a confirmation here! Please respond, so that I will ascertain on my answers.

So, for this question, can I say c,d and f are valid transitions ???

Thanking in Advance,
_Mani
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
c, d, e, and f. ("e" is correct because calling yield moves a Thread from the running state to the ready state.)

The question is #11 in Dan's single-topic exam on Threads:
  • Questions: http://www.danchisholm.net/july21/topic/section7/threads1.html
  • Answers: http://www.danchisholm.net/july21/topic/section7/threads1ans.html

  • [ October 12, 2004: Message edited by: marc weber ]
     
    Manikandan Jayaraman
    Ranch Hand
    Posts: 230
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Oh .. Marc, Thanks for that! Actually, I was expecting for the words "Runnable state" in the choices. So I oversaw the "Ready" word.

    Here ... By "Ready", he means "Runnable" state. Thats right!
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic