Research Article

Assigning Priorities for Fixed Priority Preemption Threshold Scheduling

Algorithm 3

Pseudo code for the proposed PRUNED-TRAVERSE( ) algorithm.
(1) PRUNED-TRAVERSE (Γ: set of tasks)
(2)    Γ descendingSort(Γ, );
(3)    foreach ()
(4)     ;
(5)     ;
(6)     ;
(7)     // end-foreach
(8)    return_PRUNED-TRAVERSE(1, Γ, Γ);
(9) _PRUNED-TRAVERSE (prio: priority, UnAssigned: set of tasks, Γ: set of tasks)
(10)  foreach ()
(11)   if (prio < ) continue; // pruning this path with condition C2
(12)   ;
(13)   ;
(14)   if (prio = |Γ|)
(15)     ret = RESTORING-OPT-ASSIGN-THRESHOLD(Γ);
(16)    if (ret = fail)  ;
(17)    return ret;
(18)    // end-if
(19)   if ()
(20)    ; // restore to the highest priority
(21)    if (prio > infeasiblePrioMax i) ;
(22)    continue; // pruning this path with condition C1
(23)    // end-if
(24)   ;
(25)   if (_PRUNED-TRAVERSE(prio + 1, UnAssigned −  , Γ) = success) return  success;
      // The following line is executed when the above _PRUNED-TRAVERSE( ) returned fail.
(26)   foreach () ; // restore to the highest priority
(27)  // end-foreach
(28) return  fail;