标签:end git img pack 大数据 jpg bsp 关注 大数
一、线程的优先级
1.线程优先级的获取的CPU时间片会相对多一点
(1)优先级为1-10
(2)最低为1
(3)最高为10
(4)默认为5
package com.bjpowernode.java_learning; ? public class D105_1_PriorotyOfMultithread { public static void main(String[] arsg) { System.out.println(Thread.MAX_PRIORITY); System.out.println(Thread.MIN_PRIORITY); System.out.println(Thread.NORM_PRIORITY); System.out.println("================="); Thread t1 = new Processor105(); t1.setName("t1"); Thread t2 = new Processor105(); t2.setName("t2"); System.out.println(t1.getPriority()); System.out.println(t2.getPriority()); //设置优先级 t1.setPriority(5); t2.setPriority(4); t1.start(); t2.start(); } } ? class Processor105 extends Thread{ public void run() { for(int i=0;i<5;i++) { System.out.println(Thread.currentThread().getName()+"--->"+i); } } }
三、源码:
D105_1_PriorotyOfMultithread.java
https://github.com/ruigege66/Java/blob/master/D105_1_PriorotyOfMultithread.java
2.CSDN:https://blog.csdn.net/weixin_44630050
3.博客园:https://www.cnblogs.com/ruigege0000/
4.欢迎关注微信公众号:傅里叶变换,个人公众号,仅用于学习交流,后台回复”礼包“,获取大数据学习资料
标签:end git img pack 大数据 jpg bsp 关注 大数
原文地址:https://www.cnblogs.com/ruigege0000/p/12616995.html