Computer Science, asked by assassiancreed53151, 8 months ago

What Is Default Thread Priority

Answers

Answered by SaHaBji07
0

Explanation:

In a Multi threading environment, thread scheduler assigns processor to a thread based on priority of thread. Whenever we create a thread in Java, it always has some priority assigned to it. Priority can either be given by JVM while creating the thread or it can be given by programmer explicitly.

Accepted value of priority for a thread is in range of 1 to 10. There are 3 static variables defined in Thread class for priority.

public static int MIN_PRIORITY: This is minimum priority that a thread can have. Value for this is 1.

public static int NORM_PRIORITY: This is default priority of a thread if do not explicitly define it. Value for this is 5.

public static int MAX_PRIORITY: This is maximum priority of a thread. Value for this is 10.

Answered by jessica103
0

Answer:

Each thread have a priority. Priorities are represented by a number between 1 and 10. In most cases, thread schedular schedules the threads according to their priority (known as preemptive scheduling). But it is not guaranteed because it depends on JVM specification that which scheduling it chooses.

hope you like this

please mark me as brainlist

Similar questions