A higher priority thread becomes ready
-
the current thread exhausted its time slice and there is one or more threads with the same priority as the current one
-
The time slice for a particular priority queue can be controlled by the application:
|
void main(int argc, char *argv[])
|
{
-
TCE_Thrd *thrd;
-
int prm = 0;
-
int priority = 31;
-
int slice = 10; /* 10 ms slice */
-
...
-
tce_preempt_on();
-
thrd = tce_thrd_init(func,prm);
-
tce_thrd_priority(thrd,priority);
-
tce_clock_slice(priority,slice);
-
tce_thrd_start(thrd);
-
...
-
tce_preempt_off();
-
...
|
}
|