posted 23 years ago
Threads have priorities from 1 to 10. The default is 5. If you increase the priority of the thread, the next time the system is deciding who goes next, the higher priority goes first.
Thread t1 = new Thread();
Thread t2 = new Thread();
t1.setPriority(4);
t2.setPriority(MAX_PRIORITY); //same as saying priority = 10
t2 will get prefence over t1.
"JavaRanch, where the deer and the Certified play" - David O'Meara