
Brought to You by Glagnar's Human Rinds. [?]
¡Añademe a tus favoritos!
Contacto
Post al azar
RSS
BUSCAR
Mapa de la web
Por
Saiyine
el 2007-08-23 12:14:10 - Secciones: - Enlace permanente: 789
With the next code we'll be able to control the priority our Java program's threads run.
Thread me = Thread.currentThread();
me.setPriority(Thread.MIN_PRIORITY);
For the example we've used the minimun priority, so every other process will have preference for CPU time but this. To check the others priority levels, look at the Thread object with an object inspector, or use an IDE with the ability of showing avaliable methods as you program, like Eclipse.
There's a problem: JDK has 10 priority levels, while every OS has its own number. For example, Windows NT has seven and is not uncommon for a Unix system to be in the hundreds. The best approach is to stick to MAX_PRIORITY, NORM_PRIORITY and MIN_PRIORITY within the code.
Otras entradas de la web que podrian interesarte:
. . .
. . .
. . .
. . .
Página web ©2001-2011 Saiyine descargada en s, con 5908172 visitas en total, hoy (de un total de 0 previstas).
. . .