当前位置:网站首页>线程优先级
线程优先级
2022-06-26 05:05:00 【浅墨cgz】
/** *观察线程状态 */
public class Allstate{
public static viod main(String[] args){
Thread t = new Thread(()->{
System.out.println("……");
})
//观察状态
State state = t.getState();
System.out.println(state);//NEW
}
}
线程的状态,五个状态:可以通过state查看。
线程的优先级:
范围从1到10
Thread.MIN_PRIORITY = 1
Thread.MAX_PRIORITY = 10
Thread.NORM_PRIORITY = 5
使用setPriority(int newPriority);
getPriority();
获得,和设定优先级;
设定建议在start()调用前。
注意:优先级第知识意味着获得调度的概率低。并不是绝对先调用优先级高先调。
边栏推荐
- PowerShell runtime system IO exceptions
- Why does the mobile IM based on TCP still need to keep the heartbeat alive?
- 【Unity3D】碰撞体组件Collider
- 0622 horse palm fell 9%
- Windows下安装Tp6.0框架,图文。Thinkphp6.0安装教程
- Second day of deep learning and tensorfow
- Zuul 實現動態路由
- One of token passing between microservices @feign's token passing
- [greedy college] recommended system engineer training plan
- Anti withdrawal test record
猜你喜欢

What is UWB in ultra-high precision positioning system

ModuleNotFoundError: No module named ‘numpy‘
Protocol selection of mobile IM system: UDP or TCP?
![[unity3d] rigid body component](/img/57/344aae65e4ac6a7d44b235584f95d1.png)
[unity3d] rigid body component

Why do many Shopify independent station sellers use chat robots? Read industry secrets in one minute!

Transport layer TCP protocol and UDP protocol

【Unity3D】刚体组件Rigidbody

The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!

Record a circular reference problem

Pycharm package import error without warning
随机推荐
Multipass Chinese document - remove instance
两步处理字符串正则匹配得到JSON列表
PHP二维/多维数组按照指定的键值来进行升序和降序
5. <tag-栈和常规问题>补充: lt.946. 验证栈序列(同剑指 Offer 31. 栈的压入、弹出序列)
天才制造者:独行侠、科技巨头和AI|深度学习崛起十年
Sklearn Library -- linear regression model
超高精度定位系统中的UWB是什么
Modify the case of the string title(), upper(), lower()
Yolov5 super parameter setting and data enhancement analysis
LSTM in tensorflow_ Layers actual combat
Interpretation of yolov5 training results
The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
图解OneFlow的学习率调整策略
22.2.8
Astype conversion data type
Tensorflow and deep learning day 3
6.1 - 6.2 introduction to public key cryptography
Codeforces Round #800 (Div. 2)
torchvision_transform(图像增强)
Computer Vision Tools Chain