안드로이드
Thread 우선순위 설정.
정창수
2011. 5. 3. 15:20
public class SchedulingTest4 {
public static void main(String args[]) {
Thread[] t = new RunThread4[3];
t[0] = new RunThread4("☆");
t[0].start();
t[0].setPriority(1); // ☆ 가장 느린 우선 순위
t[1] = new RunThread4("◑");
t[1].start();
t[1].setPriority(5);
t[2] = new RunThread4("○");
t[2].start();
t[2].setPriority(10); // ○ 가장 빠른 우선 순위
/*
System.out.println("t[0]" + t[0].getPriority());
System.out.println("t[1]" + t[1].getPriority());
System.out.println("t[2]" + t[2].getPriority());
*/
}
}
[출처] [52] Thread, Thread Call Back 메소드, 우선순위|작성자 철