End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Thread#priority
thr.priority → integer
thread.c
View on GitHub ↗
static VALUE
rb_thread_priority(VALUE thread)
{
return INT2NUM(rb_thread_ptr(thread)->priority);
}
Returns the priority of thr. Default is inherited from the current thread which creating the new thread, or zero for the initial main thread; higher-priority thread will run more frequently than lower-priority threads (but lower-priority threads can also run).
This is just hint for Ruby thread scheduler. It may be ignored on some platform.
Example
Thread.current.priority #=> 0
See also
#priority=
#pending_interrupt?
#native_thread_id
#raise
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0