Research Article

An Improved Task Scheduling Algorithm for Intelligent Control in Tiny Mechanical System

Algorithm 2

(1) Input: ;
(2) Initializing ; ;
(3) Constructing TID = and Set ; // N
(4) for to ;
(5) Detecting release time of all tasks;
(6)  ; ;
(7) if then
(8) Ending this loop, and detecting next release time;
(9) endif
(10) if then
(11) Refreshing ;
(12) Ending this loop, and detecting next release time;
(13) endif
(14) System finds the index in , and makes and
     ;
(15) if then
(16)  ;
(17) endif
(18) Refreshing ;
(19) endfor
(20) Output: ; the amount of task is preempted
   ; the amount of all preemptions