|
|
Home J2EE Concepts JMS Java Language Contact Back Next Bookmark this Page |
Some useful tips related to:
|
Thread PriorityJava assigns priority to each thread to determine how a thread should be treated with respect to others. Thread Priorities are integers that determine relative priorities of one thread to another. A higher priority thread does not mean that it would run faster; instead it means that this thread would be switched from a lower priority thread. This switching is called CONTEXT SWITCH. Context switching is done based on following rules: In case, two threads have same priority, the handling varies from OS to OS. Typically, Windows executes all same priority threads in round-robin manner whereas for all others, a thread must voluntarily yield control to its peers. If it doesn't do so, the other thread would not run. Caution - This means, caution must be taken while dealing with context switching for equal priority threads for developing thread centric applications for varying platforms. |
|
|
|