每个进程都有相应的优先级,优先级决定它何时运行和接收多少 CPU 时间。最终的优先级共 32 级,是从 0 到 31 的数值,称为基本优先级别(Base Priority Level)。
常规用户启动的进程优先级一般是0。
线程最终的绝对优先级是线程相对优先级和进程优先级的和。
The resulting absolute priority of a thread is the sum of this relative priority value and the priority value of its owning process.
lang package提供了线程类,支持开始,停止进程,设置进程优先级等等。
The java.lang package provides a thread class that supports methods to start and stop threads and set thread priorities, among other things.
应用推荐