Write a note on Thread priority.
Answers
Answered by
1
Thread Priorities
In the Java programming language, every thread has a priority. By default, a thread inherits the priority of its parent thread. You can increase or decrease the priority of any thread with the setPriority method. You can set the priority to any value between MIN_PRIORITY (defined as 1 in the Thread class) and MAX_PRIORITY (defined as 10). NORM_PRIORITY is defined as 5
Whenever the thread-scheduler has a chance to pick a new thread, it generally picks the highest-priority thread that is currently runnable.
Similar questions
Math,
7 months ago
Computer Science,
7 months ago
Physics,
1 year ago
Physics,
1 year ago
Hindi,
1 year ago