Forum: Ruby missing thread state?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mark V. (Guest)
on 2006-01-09 23:58
(Received via mailing list)
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.
Mark V. (Guest)
on 2006-01-10 15:56
(Received via mailing list)
On 1/9/06, Mark V. <removed_email_address@domain.invalid> wrote:
> 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.
This topic is locked and can not be replied to.