1: Input: Let Γ = { 𝜏 1 , 𝜏 2 , , 𝜏 𝑘 } be the accepted tasks in the
 ready queue, and let 𝑟 𝑖 , 𝐶 𝑖 represent the arrival time and
 expected execution time of 𝜏 𝑖 . Let the current time be 𝑡
2: Output: The new list Γ = { 𝜏 1 , 𝜏 2 , , 𝜏 𝑘 } with the speculated
 execution order and their corresponding expected
 utility density ̂ 𝜌 𝑗 for 𝜏 𝑗 , 1 𝑗 𝑘 .
3: If A task 𝜏 0 is being executed then
4:    𝑇 = 𝑟 0 + 𝐶 0 ;
5: else
6:    𝑇 = 𝑡 ;
7: end if
8: While Γ is not empty do
9:  For Each task 𝑖 in Γ   do
10:  Calculate 𝜌 𝑖 ( 𝑇 ) based on (3), (4), (5), and
   (6);
11:  end for
12:  Select 𝜏 𝑗 with the highest 𝜌 𝑗 ( 𝑇 ) ;
13:  Add 𝜏 𝑗 to the end of Γ ;
1 4 ̂ 𝜌 𝑗 = 𝜌 𝑗 ( 𝑇 ) ;
15:   𝑇 = 𝑇 + 𝐶 𝑗 ;
16:  Remove 𝜏 𝑗 from Γ ;
17: end while
Algorithm 2: Generating the speculated execution order and the expected utility for task in the ready queue.