missing thread state?

M

Mark Volkmann

I've been looking at the ri documentation for Thread.status. It's
seems like there's a thread status that isn't accounted for. What is
the status of a thread that is ready to run, but is waiting for the
scheduler to select it? Neither "run" or "sleep" seems appropriate.
 
M

Mark Volkmann

I've been looking at the ri documentation for Thread.status. It's
seems like there's a thread status that isn't accounted for. What is
the status of a thread that is ready to run, but is waiting for the
scheduler to select it? Neither "run" or "sleep" seems appropriate.

It turns out the thread status of "run" means that the thread is
*eligible* to be run, not that it is currently running. There is no
state that indicates that a given thread is currently running. I guess
that's because when a piece of code wants to check this, its thread is
the one that is running. Of course this won't work if and when we get
native threads where it's actually possible for two threads to be
running concurrently on different processors.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top