official^programmer-friendly thread states

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#getState() has the official thread states
[[ java precisely ]] and a few webpages each define a set of “thread states” but these authors don’t agree 100%.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.State.html is the official 1.5 list. However, I think this list is perhaps too academic or too low-level. There must be a programmer-friendly version of “thread states”

If you decide to maintain your own list of easy-to-understand states, the state transition diagrams/tables supplied by those authors will need some adjustments. Below are a few ineligible states i.e. ineligible to receive CPU. See post on “Running” state.

* Blocked on I/O — A java thread may enter this state while waiting for data from the IO device. The thread will move to Ready-to-Run (ie eligible) after I/O condition changes (such as reading a byte of data).
* Blocked on Synchronization — A java thread may enter this state while waiting for object lock. The thread will move to Ready-to-Run when a lock is acquired.
* waiting in wait() without argument
* waiting in join() without argument — P 16 [[ concurrent programming in java ]] says “invoking t.join() for Thread t suspends the caller until t completes.”
* timed_waiting — when a thread is waiting in
sleep()
timed wait()
timed join()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s