1: input: Let 𝜏 0 be the task currently being executed, and
𝜏 𝑝 be the task wants to preempt 𝜏 0 , current time be 𝑡 ,
𝜌 0 ( 𝜏 0 , 𝑡 ) be the conditional expected utility density of 𝜏 0
 at time 𝑡 , 𝜌 𝑝 ( 𝐶 𝑝 ) be the expected utility density of 𝜏 𝑝 ,
𝐶 𝑝 and 𝐶 0 are the expected execution time of 𝜏 𝑝 and 𝜏 0 ,
respectively;
2:
3:When a new task arrives or it is the preemption checking
 point
4: If 𝜌 𝑝 ( 𝐶 𝑝 ) 𝜌 0 ( 𝜏 0 , 𝑡 ) > 𝜁 then
5:  Check what is 𝜏 0 ’s worst case finish time;
6:  If 𝑆 𝜏 0 + 𝑊 𝐸 𝜏 0 𝐷 𝜏 0 then
7:   Preemption not allowed;
8:  else
9:   Preemption allowed;
10:  end if
11: end if
Algorithm 3: Preemption checking.