THREAD PRIORITY

No comments


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

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀