Posted By:
Anonymous
Posted On:
Monday, February 7, 2005 12:26 AM
Thread has a method called: setPriority()
You can set it to anywhere in the range from MIN_PRIORITY to MAX_PRIORTY (static fields in the Thread class)
To set it from another thread, you can do the following:
Thrad t = new Thread(this);
t.setPriority(Thread.MIN_PRIORTY); // only eat idle time
t.start();
Or from your own thread:
// make it as real-time as possible
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);