1.

Explain About Thread Priority?

Answer»

EVERY thread has a PRIORITY, usually higher priority thread gets precedence in execution but it DEPENDS on Thread Scheduler implementation that is OS dependent. We can specify the priority of thread using Thread’s setPriority(INT) method but it doesn’t guarantee that higher priority thread will get executed before lower priority thread. Thread priority is an int WHOSE value varies from 1 to 10 where 1 is the lowest priority and 10 is the highest priority.

Every thread has a priority, usually higher priority thread gets precedence in execution but it depends on Thread Scheduler implementation that is OS dependent. We can specify the priority of thread using Thread’s setPriority(int) method but it doesn’t guarantee that higher priority thread will get executed before lower priority thread. Thread priority is an int whose value varies from 1 to 10 where 1 is the lowest priority and 10 is the highest priority.



Discussion

No Comment Found