Research Article

Assigning Priorities for Fixed Priority Preemption Threshold Scheduling

Algorithm 1

Pseudo code for (a) TRAVERSE( ) [13] and (b) SEARCH( ) [1].
(1) TRAVERSE (Γ: set of tasks)
(2)   return  _TRAVERSE(1, Γ, Γ);
(3) _TRAVERSE (prio: priority, UnAssigned: set of tasks, Γ: set of tasks)
(4)   if (UnAssigned = ) return OPT-ASSIGN-THRESHOLD(Γ);
(5)   foreach ()
(6)   ;
(7)   if (_TRAVERSE(prio + 1, UnAssigned −  , Γ) = success) return success;
(8)    // end-foreach
(9)   return  fail;
(a) TRAVERSE( ) [13]
(1) SEARCH (Γ: set of tasks)
(2)   return _SEARCH(1, Γ, Γ);
(3) _SEARCH (prio: priority, UnAssigned: set of tasks, Γ: set of tasks)
(4)   if (UnAssigned = ) return OPT-ASSIGN-THRESHOLD(Γ);
(5)   foreach ()
    // WCRT(, prio): with () under fully preemptive fixed priority scheduling
    //       assuming all tasks in UnAssigned have the highest priority.
(6)   (, prio) −  ;
(7)   if ()
(8)     ;
(9)     return _SEARCH(prio + 1, UnAssigned −  , Γ);
(10)      // end-if
(11)   // end-foreach
(12)  SortedList ← ascendingSort(UnAssigned, );
(13)  RefinedList ← Refine(SortedList); // eliminating infeasible tasks even with the highest preemption threshold
(14)  foreach ()
(15)     ;
(16)     if (_SEARCH(prio + 1, UnAssigned −  , Γ) = success) return success;
(17)   // end-foreach
(18)  return  fail;
(b) SEARCH( ) [1]