Research Article

On-Line Real-Time Service-Oriented Task Scheduling Using TUF

Algorithm 1

The scheduling algorithm based on opportunity cost.
1: Input: Let { 𝜏 1 , 𝜏 2 , … , 𝜏 π‘˜ } be the accepted tasks in the
 ready queue, and let 𝐢 𝑖 be the expected execution time of
  𝜏 𝑖 . Let current time be 𝑑 and let 𝜏 0 be the task currently
 being executed, expected execution time of 𝜏 0 is 𝐢 0 . Let
 the expected utility density threshold be 𝛿 .
2:
3: if A new task, that is, 𝜏 𝑝 arrives then
4:  Accept 𝜏 𝑝 if 𝜌 𝑝 ( 𝐢 0 ) > 𝛿 ;
5:  Reject 𝜏 𝑝 if 𝜌 𝑝 ( 𝐢 0 ) ≀ 𝛿 ;
6:  Remove 𝜏 𝑗 in the ready queue end if 𝜌 𝑗 ( 𝐢 0 ) ≀ 𝛿 ;
7: end if
8:
9: If 𝜏 0 is completed then
10:  Choose 𝜏 𝑖 with the largest system utility density, that is,
    Μƒ 𝜌 𝑖 ( 𝑑 ) = m a x π‘˜ Μƒ 𝜌 π‘˜ ( 𝑑 ) .
11:  Remove 𝜏 𝑗 in the ready queue if 𝜌 𝑗 ( 𝐢 𝑖 ) < 𝛿 ;
12: end if
13:
14: If 𝑑 = the critical time of 𝜏 0   then
15:  Abort 𝜏 0 immediately;
16:  Choose 𝜏 𝑖 with the largest system utility density, that is,
  Μƒ 𝜌 𝑖 ( 𝑑 ) = m a x π‘˜ Μƒ 𝜌 π‘˜ ( 𝑑 ) .
17:  Remove 𝜏 𝑗 in the ready queue if 𝜌 𝑗 ( 𝐢 𝑖 ) < 𝛿 ;
18: end if