THREAD PRIORITY
Thread priority are used by the thread scheduler to decide when each thread should be allowed to run. Java permits us to set the priority of a thread using the setPriority()method as follows –
ThreadName.setPriority(intNumber);
The intNumber is an integer value to which the threads priority is set. The thread class defined several priority constants –
MIN_PRIORITY=1
NORM_PRIORITY=5
MAX_PRIORITY=10
The intNumber may assume one of this constant of any value between 1 to 10. Note that the default set is NORM_PRIORITY
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment