Java and Linux Thread Prioirties?
Discussion
Done a bit of googling on this one but keep coming up blank.
Anyone know off hand what the OS Thread Priority Levels for Linux are?
I'm using RedHat with Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
I wanna experiment with one of our systems and it's performance by tweaking the Thread Priority Levels inside a Java App, At the moment they are being set to '5' but I have no idea where this lies on the scale of options.
cheers
Ex
Anyone know off hand what the OS Thread Priority Levels for Linux are?
I'm using RedHat with Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
I wanna experiment with one of our systems and it's performance by tweaking the Thread Priority Levels inside a Java App, At the moment they are being set to '5' but I have no idea where this lies on the scale of options.
cheers
Ex
Sun said:
Each thread has a numeric priority between MIN_PRIORITY and MAX_PRIORITY (constants defined in the Thread class). At any given time, when multiple threads are ready to be executed, the highest-priority thread is chosen for execution. Only when that thread stops or is suspended will a lower-priority thread start executing.
Plotloss said:
Sun said:
Each thread has a numeric priority between MIN_PRIORITY and MAX_PRIORITY (constants defined in the Thread class). At any given time, when multiple threads are ready to be executed, the highest-priority thread is chosen for execution. Only when that thread stops or is suspended will a lower-priority thread start executing.
Thanks, I guess it must just be that simple then eh?
Thread MAX Priority:10
Thread NORM Priority:5
Thread MIN Priority:1
I assume it will follow with NICE/RENICE
Man Page said:
DESCRIPTION
The nice utility runs utility at an altered scheduling priority, by
incrementing its ``nice'' value by the specified increment, or a default
value of 10. The lower the nice value of a process, the higher its
scheduling priority.
The superuser may specify a negative increment in order to run a utility
with a higher scheduling priority.
Some shells may provide a builtin nice command which is similar or iden-
tical to this utility. Consult the builtin(1) manual page.
Users other than the super-user may only alter the priority of processes
they own, and can only monotonically increase their ``nice value'' within
the range 0 to PRIO_MAX (20). (This prevents overriding administrative
fiats.) The super-user ay alter the priority of any process and set the
priority to any value in the range PRIO_MIN (-20) to PRIO_MAX. Useful
priorities are: 20 (the affected processes will run only when nothing
else in the system wants to), 0 (the ``base'' scheduling priority), any-
thing negative (to make things go very fast).
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


