[Java] 스레드(Thread) 우선순위 - (MIN, NORM, MAX)_PRIORITY
자바 Thread 클래스에는 스레드의 우선순위를 정할 수 있는 메서드가 있다. Thread.MIN_PRIORITY(=1) ~ Thread.MAX_PRIORITY(=10) 디폴트 우선순위 : Thread.NORM_PRIORITY(=5) 우선순위가 높아진다고 무조건 높아지는 것이 아니라 높아질 확률이 올라가는 것이다 setPriority() / getPriority() Thread 우선순위 예제 class PriorityThread extends Thread { public void run() { Thread t = Thread.currentThread(); System.out.println(t + "start"); System.out.println(t.getPriority() + "end"); } } pu..
2022.02.27