摘要 |
Instead of a conventional task scheduler in which tasks having a high priority are preferentially scheduled, so that the execution of tasks with very low priorities is blocked, a "fair scheduler" is proposed in which each task (TA to TE) is assigned a counter (CNT) and a threshold value (THD), with the threshold value specifying a maximum number of execute cycles within which the task need not be executed immediately, and the counter counting those execute cycles within which the task is not executed. At the beginning of each execute cycle, a test is made to determine whether one of the counters exceeds the associated threshold value. If that is the case, one (TD) of the corresponding tasks (TC, TD) is selected by a selection criterion and executed, and its counter is reset. The counters assigned to the remaining tasks are incremented by one, and the execute cycle is repeated if it is found that at least one more of the tasks (TC) is waiting to be processed.
|