A thread priority is used to decide when to switch from one running thread to the next. This is called as Context switch.
There are certain rules, where the thread can context switch.
1. A thread can voluntarily relinquish control.
2.A thread can be preempted(Serve) by higher priority thread.
We can set the thread a priority which means that it will not execute in higher speed, when compared to the low priority thread it means threads will be utilizing the CPU based on the higher priority.
Also thread priories will be used by the Thread Scheduler to decide when each thread should be allowed to run. In Theory, over a given period of time higher priority thread gets more CPU time than the lower priority threads.
Priority can range from 1 to 10.
min_priority to max_priority. To return a thread to default priority, specify it as normal_prioerity which is currently 5.
There are certain rules, where the thread can context switch.
1. A thread can voluntarily relinquish control.
2.A thread can be preempted(Serve) by higher priority thread.
We can set the thread a priority which means that it will not execute in higher speed, when compared to the low priority thread it means threads will be utilizing the CPU based on the higher priority.
Also thread priories will be used by the Thread Scheduler to decide when each thread should be allowed to run. In Theory, over a given period of time higher priority thread gets more CPU time than the lower priority threads.
Priority can range from 1 to 10.
min_priority to max_priority. To return a thread to default priority, specify it as normal_prioerity which is currently 5.
No comments:
Write comments