线程的优先级
线程的优先级等级
MAX_PRIORITY
:
10
MIN _PRIORITY
:
1
NORM_PRIORITY
:
5
这几个是Thread类的属性,是常量,不能修改其值
涉及的方法
getPriority()
:
返回线程优先值
setPriority(int newPriority)
:
改变线程的优先级
说明
线程创建时继承父线程的优先级
低优先级只是获得调度的概率低,并非一定是在高优先级线程之后才被调用