Regular Java™ threads, that is, threads allocated as java.lang.Thread objects, can use scheduling policies SCHED_OTHER, SCHED_RR or SCHED_FIFO. Real-time threads, that is, threads allocated as java.lang.RealtimeThread, and asynchronous event handlers use the SCHED_FIFO scheduling policy.
Regular Java threads use the default scheduling policy of SCHED_OTHER, unless the JVM is started by a thread with policy SCHED_RR or SCHED_FIFO. Regular Java threads that use the policy SCHED_OTHER have the operating system thread priority set to 0. Regular Java threads that use the policy SCHED_RR or SCHED_FIFO inherit the priority of the thread that starts the JVM. For more information about priorities and policies for regular Java threads, see Regular Java thread priorities and policies.
javax.realtime.PriorityScheduler().getMinPriority()returns 11, and:
javax.realtime.PriorityScheduler().getMaxPriority()returns 38.
OS priorities 81 - 89 are used by the IBM® JVM for dispatching worker threads. These threads are all designed to do a small amount of work before going back to sleep. The threads are as follows:
The Metronome GC Trace thread runs at OS priority 12, and the JIT Sampler thread, which samples Java methods for compilation, runs at OS priority 13.
The JIT Compilation thread (which is different from the JIT Sampler thread) runs with the SCHED_OTHER policy at OS priority 0.
The JIT compilation and JIT sampler threads are both disabled if -Xnojit or -Xint is specified.
The Metronome Garbage Collector and finalizer priority constantly changes (before each round of collection) to be above the highest priority heap-allocating thread. You must ensure that the priority of heap-allocating threads is below that of NoHeapRealtimeThreads.
A heap-allocating thread is any non-NHRT user thread that is not asleep or blocked on a monitor. A user thread running native code outside the JNI interface is not considered to be heap-allocating. If a garbage collection is in progress when a heap-allocating thread wakes up, is no longer blocked on a monitor, or leaves JNI, it is forced to wait until the garbage collection has finished before it can continue.
OS priority 81 is reserved for internal JVM threads that are allocating from the heap. If an internal JVM thread is at OS priority 81, the garbage collector runs at OS priority 82. When the only heap-allocating user threads are not real-time threads, the GC priority runs at OS priority 11. Otherwise, the GC runs at a priority that is one OS priority higher than the highest priority heap-allocating user thread.
The GC priority is adjusted just before a round of collection.