• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Thread states?

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Which of the following thread state transitions model the lifecycle of a thread?
a. The Dead state to the Ready state
b. The Ready state to the Not-Runnable state
c. The Ready state to the Running state
d. The Running state to the Not-Runnable state
e. The Running state to the Ready state
f. The Not-Runnable state to the Ready state
g. The Not-Runnable state to the Running state




Please Help me to understand the options!!!


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

There are these states: new,ready/runnable,running,not-runnable states(blocked,waiting,sleeping) and dead.

So, I think the question is trying to validate if you know what steps are logical between these states.

Regards..

"Doubt is the vestibule which we all must pass through before we can enter the temple of truth." Osho

Victor Velazquez
Mexico
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is from Khalid Mughal:

-------------------
Ready-to-run state

A thread starts life in the Ready-to-run state (see p. 369).

Running state

If a thread is in the Running state, it means that the thread is currently executing (see p. 369).

Dead state

Once in this state, the thread cannot ever run again (see p. 380).

Non-runnable states

A running thread can transit to one of the non-runnable states, depending on the circumstances. A thread remains in a non-runnable state until a special transition occurs. A thread does not go directly to the Running state from a non-runnable state, but transits first to the Ready-to-run state.

The non-runnable states can be characterized as follows:

Sleeping: The thread sleeps for a specified amount of time

Blocked for I/O: The thread waits for a blocking operation to complete

Blocked for join completion: The thread awaits completion of another thread

Waiting for notification: The thread awaits notification from another thread

Blocked for lock acquisition: The thread waits to acquire the lock of an object
-----------

[ April 24, 2007: Message edited by: Tina Tibrewal ]
[ April 24, 2007: Message edited by: Tina Tibrewal ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic