Research Article
Applying Dynamic Priority Scheduling Scheme to Static Systems of Pinwheel Task Model in Power-Aware Scheduling
Algorithm 1
A power-aware scheduling algorithm.
When task arrived, completed and at deadline | if (ex_flag) increase_temporal_idleness() | else if (cpu was idle) decrease_temporal_idleness() | insert into TC (at completed) or delete (at deadline) | recompute TU = TU ± (when arrived or at deadline) | last_cpu_speed = compute_cpu_speed () | if there is no ready task to execute then set cpu as idle | else set cpu speed as last_cpu_speed | compute_cpu_speed( ) // is the highest priority ready task or null | cpu_speed = CU | for all tasks at TC | if or is null | cpu_speed −= ( − ( − )) | if cpu_speed < 0 then ex_flag = 1; break; | else | ex_flag = 1; break; | return (cpu_speed) or (0 if cpu_speed < 0) | decrease_temporal_idleness() | idle_work = idle_period last_cpu_speed | for all tasks at TC | if ( − ( − )) ≥ idle_work | decrease as much as idle_work; break; | else | idle_work −= ( − ( − )); = − ; | increase_temporal_idleness() | for each unused slack of tasks | distribute unused slack evenly until deadline |
|