当前位置:网站首页>线程优先级
线程优先级
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()调用前。
注意:优先级第知识意味着获得调度的概率低。并不是绝对先调用优先级高先调。
边栏推荐
- 2022.1.23
- pycharm 导包错误没有警告
- 6.1 - 6.2 公鑰密碼學簡介
- The best Chinese open source class of vision transformer, ten hours of on-site coding to play with the popular model of Vit!
- 【Unity3D】刚体组件Rigidbody
- Rsync common error messages (common errors on the window)
- First day of deep learning and tensorflow learning
- 【quartz】从数据库中读取配置实现动态定时任务
- 6.1 - 6.2 公钥密码学简介
- A method of quickly transplanting library function code to register code by single chip microcomputer
猜你喜欢

为什么许多shopify独立站卖家都在用聊天机器人?一分钟读懂行业秘密!

Pycharm package import error without warning

MySql如何删除所有多余的重复数据
![[unity3d] rigid body component](/img/57/344aae65e4ac6a7d44b235584f95d1.png)
[unity3d] rigid body component

ROS notes (07) - Implementation of client and server

Using requests library and re library to crawl web pages

一个从坟墓里爬出的公司
A beginner's entry is enough: develop mobile IM from zero

2. < tag dynamic programming and conventional problems > lt.343 integer partition

Machine learning final exercises
随机推荐
Illustration of ONEFLOW's learning rate adjustment strategy
C# 39. string类型和byte[]类型相互转换(实测)
Zuul 实现动态路由
Keras actual combat cifar10 in tensorflow
Create a binary response variable using the cut sub box operation
Multipass Chinese document - setup driver
Modify the case of the string title(), upper(), lower()
PHP之一句话木马
Sentimentin tensorflow_ analysis_ layer
Statsmodels Library -- linear regression model
ssh连win10报错:Permission denied (publickey,keyboard-interactive).
Dbeaver installation and configuration of offline driver
6.1 - 6.2 公钥密码学简介
SSH connected to win10 and reported an error: permission denied (publickey, keyboard interactive)
Simple application of KMP
GD32F3x0 官方PWM驱动正频宽偏小(定时不准)的问题
Muke.com actual combat course
Tensorflow and deep learning day 3
Collections and dictionaries
Using requests library and re library to crawl web pages