aspose file tools
The moose likes Java in General and the fly likes Thread State Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Thread State" Watch "Thread State" New topic

Thread State

Ahmed Basheer
Ranch Hand

Joined: Apr 15, 2004
Posts: 77
If there is the blocking socket read call in a thread, what would be the state of the thread? I would assume the state of the thread to be blocked but it is not. The state of the thread to my surprise is RUNNABLE.

e.g The state of the folloeing thead is RUNNABLE even though the socket is
blocked on read call.Any Observations?

new Thread ()
public void run()

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12913
I suspect the aswwer is that since the Thread is blocked while executing native code, as far as Java is concerned it is still Runnable. I see that in Java 1.5 we have a java.lang.Thread.State Enum - see the JavaDocs for the exact meaning of the various states.
Have you tried LearnNowOnline?
subject: Thread State