Vous êtes sur la page 1sur 33

Real-time systems Real-time scheduling of independent tasks

Mathieu Delalandre

Real-time scheduling of independent tasks


1. 2. 3. About real-time scheduling Process and diagram models Basic on-line algorithms for periodic tasks 3.1. Basic scheduling algorithms 3.2. Sufficient conditions 4. Hybrid task sets scheduling 4.1. Introduction to hybrid task sets scheduling 4.2. Hybrid scheduling algorithms

About real-time scheduling (1)


There are very important basic properties that real-time systems must have to support critical applications. Comparing to no real time systems, at general level (hardware, system and programming) this concerns: System Features Scalability Maintainability Fault tolerance Design for peak load Timeliness Predictability no real-time ++ + + + no no real-time + ++ ++ ++ yes yes Features OS type Interrupt handling Context switch (dispatcher) Process model Scheduling IPC and synchronization Resource management Considering the operating system level, real-time OS are based on kernels which are modified versions of time sharing OS (i.e. no real-time). As a consequence, they have the same basic features and differ in terms of Operating System non real-time full OS slow slow basic similar different different real-time micro kernel fast fast extended

About real-time scheduling (2)


(Short-term) scheduler is a system process running an algorithm to decide which of the ready, in-memory processes, are to be executed (allocated a CPU). The short-term scheduler is concerned mainly with: CPU utilization: Throughput: Turnaround time: Waiting time: Response time: Avoid starvation: Etc. to keep the CPU as busy as possible. number of processes that complete their execution per time unit. total time between submission of a process and its completion. amount of time a process has been waiting in the ready queue. amount of time it takes to complete a process. A process is never loaded to CPU

Depending of the considered systems (Mainframes, Server computers, Personal Computers (PC), Real Time Systems, Embedded systems & Handheld systems, etc. ) schedulers could be designed in different ways:
algorithms features preemptive without deadline no preemptive with deadline both without deadline both both

independants

dependants dynamic priority periodic tasks with resource

both both aperiodic both Time-sharing OS

both real-time OS 4 both both both

Scheduling problems

Processus model

static priority aperiodic task without resource

lazy processor Type of system mono-core centralized

full-time busy processor multi-core distributed

lazy processor both centralized

lazy processor both centralized

Real-time scheduling of independent tasks


1. 2. 3. About real-time scheduling Process and diagram models Basic on-line algorithms for periodic tasks 3.1. Basic scheduling algorithms 3.2. Sufficient conditions 4. Hybrid task sets scheduling 4.1. Introduction to hybrid task sets scheduling 4.2. Hybrid scheduling algorithms

Process and diagram models (1)


Process model and context parameters PID w0 C P s e RT = e-w0 WT = RT-C C(t) processus number wakeup time (in the ready queue) capacity priority start time (run as first time) end time (termination) response time waiting time residual capacity la date t (0 C(t) C) RT
Process parameters

process

WT

WT C(t)

context parameters

w0 C(t) C

s t

0 t

Process and diagram models (2)


Task (i.e. process) model and context parameters PID r0 (i.e. w0) C P processus number release time (in the ready queue) capacity priority
Process parameters

T D

D T rk = r0 + kT sk ek (or f) dk = rk + D

relative deadline period the kth release the kth start time the kth end (finishing) time the kth absolute deadline

Extended parameters for real real-time

r0 C

d0

r0+T

context parameters

T D

T D

0 CDT well formed task L k = e k - dk Lateness Ek=max(0,Lk) Tardiness or exceeding time

r0

d0

r1

d1

r2

Process and diagram models (3)


e.g. here is a random CPU diagrams (i.e. virtual scheduling algorithms) respecting scheduling constraints, absolute deadlines and releases for the following set of task r0 T1 T2 0 2 C 2 4 D 4 7 T 5 9 k T1 0 1 r0 0 d0 4 r1 5 d1 r 2 9 10 d2 r3 14 15 d3 r4 19 20 2 3 sk ek Lk Ek 0 5 2 7 -2 -2 0 0 0 0

10 12 -2 15 17 -2

T2 r0 2 d0 9 r1 11 d1 18 r2 20

k 0 1

sk ek Lk Ek 2 8 -1 0 0 0 12 18

Process and diagram models (4)


Task (i.e. process) model and context parameters, next
C u= T

processor utilization factor


n

C(t)

U = ui =
i =1 i =1

Ci Ti

mean processor utilization factor processor load factor (ch 1)

ch =

C D
n n i =1 i =1

CH = chi =

context parameters

Ci Di

mean processor load factor residual relative (absolute) deadline (0 D(t) D i.e. D(t) = max(d-t,0)) residual load 0 CH (t )
if C (t ) = D (t ) CH (e) = 1

r0 s

t D(t)

D(t) = d-t

CH(t) = C(t)/D(t)

r0 s

L = D-C L(t) = D(t) - C(t)

nominal laxity residual nominal laxity

Process and diagram models (5)


r0 C Ta 2 4 D 7 T 9 2
t C(t) D(t) CH(t) 10-2 L(t) 0-1 1-2 2-3 4-3 7-6 3-4 3-2 6-5 4-5 2-1 5-4

T 5
5-6 1-1 4-3

7
6-7 1-1 3-2

8
7-8 1-0 2-1

9
8-9 0-0 1-0 0-Na 1-0

11
9-10

12

15

17

18

20
17-18 1-0 1-0 1819 19-20

10-11 11-12 12-13 13-14 14-15 15-16 16-17 4-4 7-6 4-3 6-5 3-2 5-4 2-1 4-3 1-1 3-2 1-1 2-1

57-50 50-40 40-25 25-33 33-50 50-00 3-3 3-3 3-3 3-2 2-1 1-1

57-66 66-60 60-50 50-33 33-50 50-100 100-Na 3-2 2-2 2-2 2-2 2-1 1-0 0-0

CH(t) decreases when C(t) decreases CH(t) grows when C(t) is constant
8 7 6 5 4 3 2 1 0 0 2 4 6 8 10 12 14 16 18 0,0 0,4 0,2 0,8 0,6 D(t) C(t) CH(t) 1,0

L(t) is constant when the task is running L(t) decreases when the task is waiting
8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 D(t) C(t) L(t)

10

Real-time scheduling of independent tasks


1. 2. 3. About real-time scheduling Process and diagram models Basic on-line algorithms for periodic tasks 3.1. Basic scheduling algorithms 3.2. Sufficient conditions 4. Hybrid task sets scheduling 4.1. Introduction to hybrid task sets scheduling 4.2. Hybrid scheduling algorithms

11

Basic scheduling algorithms

Algorithm Rate Monotonic (RM) Deadline Monotonic (DM) Earliest Deadline (ED) Least Laxity (LL)

Preemptive Criterion yes yes yes yes T D D(t) L(t)

Priority static static dynamic dynamic

12

Basic scheduling algorithms Rate Monotonic (RM)


For a set of periodic tasks, assigning the priorities to the rate monotonic (RM) algorithm means that tasks with shortest periods T (i.e. the higher request rates) get higher priorities. e.g. r0 T1 T2 T3 0 0 0 C 3 2 2 T 20 5 10
0 T3 2 5 7 10 12 15 17 20 T2

According to T values and RM scheduling, priority order is given to T2 (T=5), T3 (T=10) and T1 (T=20)

0 T1

10

12

14

20

20

13

Basic scheduling algorithms Deadline Monotonic (DM)


The deadline monotonic (or inverse deadline) algorithm assigns to task according to their relative deadlines D: the task with the shortest relative deadline is assigned to the highest priority. e.g. r0 T1 0 T2 0 T3 0 C 3 2 2 D 4 T 5 According to the D values and the DM scheduling, priority order is given to T2 (D=4), T1 (D=7) and T3 (D=9)
T2

7 20 9 10

9 10

12

14 15

17

19 20

T1

0 T3

20

9 10

12

14

19 20

14

Basic scheduling algorithms

Algorithm Rate Monotonic (RM) Deadline Monotonic (DM) Earliest Deadline (ED) Least Laxity (LL)

Preemptive Criterion yes yes yes yes T D D(t) L(t)

Priority static static dynamic dynamic

15

Basic scheduling algorithms Earliest Deadline (ED)


The earliest deadline (first) algorithm assigns priority to tasks according to their residual relative deadline D(t): the task with the earliest absolute deadline will be executed at the highest priority. e.g. r0 C D T T1 0 T2 0 T3 0 3 2 1 7 20 4 5
T1 C(t) 3-3 4-3 2-1 8-7 1-1 3-3 3-2 1-0 7-6 1-1 6-5 1-1 5-4 1-1 4-3 1-1 3-2 2-1 2-1 1-0 1-0 4-3 2-2 3-2 1-0 3-2 2-1 2-1 2-1 1-0 1-0 1-0 4-3 2-1 8-7 1-1 3-2 1-0 7-6 1-1 6-5 1-0 5-4 4-3 2-1 1-0 4-3 2-1 3-2 3-2 1-0 2-1 1-0 2-1 D(t) T2 C(t) D(t) T3 C(t)

According to the D(t) values and the ED scheduling, priority order on the slot[ 0-18] is given to
T D(t) 0-1 7-6 1-2 6-5 2-3 5-4 3-4 4-3 4-5 3-2 5-6 2-1 6-7 1-0 7-8 8-9 9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18

8 10

Task with lowest D(t) starts first Once C(t) at zero, we shift to the lowest D(t)

T2 restarts at r0+T T3 can be executed at first time

16

Basic scheduling algorithms Least Laxity (LL)


The least laxity (first) algorithm assigns priority to tasks according to their nominal residual laxity L(t): the task with the smallest laxity will be executed at the highest priority. e.g. r0 C D T T1 0 T2 0 T3 0 3 2 1 7 20 4 5
T1 C(t) L(t) 3-3 2-2 2-1 7-6 1-1 3-3 2-2 1-0 6-5 1-1 5-4 1-1 4-3 1-1 3-2 1-1 3-2 2-1 1-0 2-2 2-1 2-1 1-1 2-1 1-1 1-1 1-0 1-1 1-0 2-2 2-1 7-6 1-1 2-2 1-0 6-5 1-1 5-5 1-0 2-2 2-1 2-2 1-0

We compute the values L(0) i.e. the nominal laxity. According to the L(t) values and the ED scheduling, priority order on the slot[ 0-18] is given to
t L(t) 0-1 4-3 1-2 3-2 2-3 2-2 3-4 2-2 4-5 2-2 5-6 6-7 7-8 8-9 9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18

8 10

L(0) T1 7-3=4 T2 4-2=2 T3 8-1=7

T2 C(t) L(t) T3 C(t)

T2 of lowest laxity L(t) starts, L2(t) is constant when T2 running, L3(t) and L1(t) decrease since T2,T3 are waiting Once C2(t) at zero, We shift to the lowest Li(t), T1 is scheduled first

T3 ends, T2 restarts L3(t) lowest, T3 is scheduled T2 restarts with T=5, L2(t) and L3(t) are equivalent, We consider here the task id T1 > T2 > T3

only T2 restarts T2 et T3 are starting a new period L2(t) < L3(t), T2 is cheduled first

17

Real-time scheduling of independent tasks


1. 2. 3. About real-time scheduling Process and diagram models Basic on-line algorithms for periodic tasks 3.1. Basic scheduling algorithms 3.2. Sufficient conditions 4. Hybrid task sets scheduling 4.1. Introduction to hybrid task sets scheduling 4.2. Hybrid scheduling algorithms

18

Sufficient conditions
A set of periodic task is schedulable with the RM, DM, ED and LL algorithms if they respect the following sufficient conditions. A sufficient condition is one that, if satisfied, assures the statement's truth. (i.e. a necessary condition of a statement must be satisfied for the statement to be true).
n

Rate Monotonic

T
i =1
n i =1

Ci
i

n(21 n 1)
n(21 n 1)

i.e. mean utilization processor factor lowest to

Deadline Monotonic

D
n i =1

Ci
i

i.e. mean processor load factor lowest to Earliest Deadline Least Laxity

Ci
i

C T1 T2 T3 1 2 2

D 5 4 7

T 5 7 8

n(21 n 1) = 3 21 3 1 = 0,7798

0,7357 0,7798
0,9857 0,7798 0,9857 1

can be scheduled with Rate Monotonic cant be scheduled with Deadline Monotonic can be scheduled with Earliest Deadline and Least Laxity

C 1 2 2 Ti = 5 + 7 + 8 = 0,7357 i =1 i
n i =1

Ci
i

1 2 2 + + = 0,9857 5 4 7

19

Real-time scheduling of independent tasks


1. 2. 3. About real-time scheduling Process and diagram models Basic on-line algorithms for periodic tasks 3.1. Basic scheduling algorithms 3.2. Sufficient conditions 4. Hybrid task sets scheduling 4.1. Introduction to hybrid task sets scheduling 4.2. Hybrid scheduling algorithms

20

Introduction to hybrid task sets scheduling (1)


Basic on-line algorithms deal with homogeneous set of tasks where all are periodic. However, some real-time applications may require aperiodic tasks. Use periodic aperiodic regular event in the system irregular event in the system Constraint strict deadline could be strict or relative

Hybrid task set scheduling deals with the both type of (2) Go up: The timetask. Such a scheduling is based on hybrid scheduler, composed of a real-time scheduler combined with a time- sharing level shifts to the real-time one sharing one. Shifting between the two levels is controlled regarding a criterion according to some go-up and go-down criteria.

Real-time scheduler Time-sharing scheduler

(1) Go down: The realtime level shifts to the time-sharing one regarding a criterion

Two main approaches exist to design hybrid schedulers (1) Background/joint processing exploits free idle time of the processor to schedule the aperiodic tasks, or to schedule jointly the aperiodic and periodic tasks. (2) Server based processing implements a virtual periodic task (i.e. the server) in charge of scheduling of the aperiodic tasks.

21

Introduction to hybrid task sets scheduling (2)


Aperiodic constraint scheduler type Schedulers periodic aperiodic periodic aperiodic preemptive criterion Idle time 0 Idle time 0 Da(t) < Dp(t) aperiodic periodic preemptive criterion

Algorithms

Background scheduling

relative

background

RM

FCFS

no

yes

Idle time = 0

Idle joint scheduling Joint scheduling

relative/strict strict

background background

ED ED

ED ED

no yes

yes yes

Idle time = 0 Da(t) > Dp(t)

Slack Stealing

relative

background

RM

FCFS

yes

L(t)>0

yes

L(t)=0

Pooling Sporadic Sever

relative relative

Server server

RM RM

FCFS FCFS

yes yes

polling polling

yes/no yes/no

polling polling

22

Real-time scheduling of independent tasks


1. 2. 3. About real-time scheduling Process and diagram models Basic on-line algorithms for periodic tasks 3.1. Basic scheduling algorithms 3.2. Sufficient conditions 4. Hybrid task sets scheduling 4.1. Introduction to hybrid task sets scheduling 4.2. Hybrid scheduling algorithms

23

Algorithms

Aperiodic constraint

scheduler type

Schedulers periodic aperiodic

periodic aperiodic preemptive criterion Idle time 0 Idle time 0 Da(t) < Dp(t)

aperiodic periodic preemptive criterion

Background scheduling

relative

background

RM

FCFS

no

yes

Idle time = 0

Idle joint scheduling Joint scheduling

relative/strict strict

background background

ED ED

ED ED

no yes

yes yes

Idle time = 0 Da(t) > Dp(t)

Slack Stealing

relative

background

RM

FCFS

yes

L(t)>0

yes

L(t)=0

Pooling Sporadic Sever

relative relative

Server server

RM RM

FCFS FCFS

yes yes

polling polling

yes/no yes/no

polling polling

24

Hybrid task set scheduling Background scheduling


Aperiodic tasks are scheduled on the processor idle time once all the periodic tasks ended. Periodic and aperiodic tasks are scheduled according to RM and FCFS strategies respectively.

Rate Monotonic (2) FCFS (1) If they are no periodic task ready to be executed (2) Whenever a periodic task restarts (1)

r0 C Tp1 Tp2 Ta1 0 0 4 2 2

T 5 10
Tp1 Tp2

T C(t) C(t)

0-1 2-1 2-2

1-2 1-0 2-2

2-3

3-4

4-5

5-6 2-1

6-7 1-0

7-8

8-9

9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18 18-19 2-1 2-2 1-0 2-2 2-1 1-0 2-1 1-0

2-1

1-0

Idle time Ta1 Ta2 Ta3 C(t) C(t) C(t) 2-1 1-1 1-1 1-0 1-1 1-1 2-2 1-1 2-2 1-1 2-2 1-0 2-2 2-2 2-2 2-1 1-0

2 Na 1 Na 2 Na

Ta2 10 Ta3 11

RM scheduling between Tp1, Tp2

First idle time, Ta1 is ready and can be scheduled

Ta2, Ta3 blocked while periodic tasks are running

25

Algorithms

Aperiodic constraint

scheduler type

Schedulers periodic aperiodic

periodic aperiodic preemptive criterion Idle time 0 Idle time 0 Da(t) < Dp(t)

aperiodic periodic preemptive criterion

Background scheduling

relative

background

RM

FCFS

no

yes

Idle time = 0

Idle joint scheduling Joint scheduling

relative/strict strict

background background

ED ED

ED ED

no yes

yes yes

Idle time = 0 Da(t) > Dp(t)

Slack Stealing

relative

background

RM

FCFS

yes

L(t)>0

yes

L(t)=0

Pooling Sporadic Sever

relative relative

Server server

RM RM

FCFS FCFS

yes yes

polling polling

yes/no yes/no

polling polling

26

Hybrid task set scheduling (Idle) joint scheduling


Aperiodic tasks are scheduled on the processor idle time once all the periodic tasks ended. Periodic and aperiodic tasks are scheduled according to a ED strategy in both case.

Earliest Deadline (2) Earliest Deadline (1) If they are no periodic task ready to be executed (2) Whenever a periodic task is ready to be executed (1)

r0 Tp1 Tp2 Tp3 Ta1 0 0 0 4

C 3 2 1 2 1 1

D 7 4 8

T 20 5 10
Tp2 Tp1

T D(t) C(t) D(t) C(t) D(t) Tp3 C(t) Idle time

0-1 7-6 3-3 4-3 2-1 8-7 1-1

1-2 6-5 3-3 3-2 1-0 7-6 1-1

2-3 5-4 3-2 2-1

3-4 4-3 2-1 1-0

4-5 3-2 1-0

5-6 2-1

6-7 1-0

7-8

8-9

9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18

4-3 2-2

3-2 2-1 2-1

2-1 1-0 1-0

1-0

4-3 2-1 8-7 1-1

3-2 1-0 7-6 1-1

2-1

1-0

4-3 2-1

3-2 1-0 2-1

2-1

6 Na 8 Na 5 Na

6-5 1-1

5-4 1-1

4-3 1-1

3-2 1-0

6-5 1-0

5-4

4-3

3-2

1-0

Ta2 10 Ta3 11

D(t) Ta1 C(t) D(t) Ta2 C(t) D(t) Ta3 C(t)

6-5 2-2

5-4 2-2

4-3 2-2

3-2 2-2

2-1 2-1

1-0 1-0 8-7 1-1 7-6 1-1 5-4 2-2 6-5 1-1 4-3 2-2 5-4 1-1 3-2 2-1 4-3 1-1 2-1 1-0 3-2 1-1 1-0 2-1 1-1 1-0 1-0

First idle time, Ta1 is ready and can be scheduled

Ta2 and Ta3 are scheduled according to a ED strategy on the idle time

27

Hybrid task set scheduling Joint scheduling


Periodic and aperiodic tasks are scheduled jointly according to an ED strategy.

Earliest Deadline (2) Earliest Deadline (1) If the residual deadlines D(t) of periodic tasks are up to the residual deadline D(t) of a given aperiodic task (2) Whenever a residual deadline D(t) of a periodic task becomes lower.
6-7 7-8 8-9 9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18

(1)

r0 Tp1 Tp2 Tp3 Ta1 0 0 0 4

C 3 2 1 2 1 1

D 7 4 8

T 20 5
Tp2 Tp1

T C(t) D(t) C(t) D(t) C(t) Tp3 D(t)

0-1 3-3 7-6 2-1 4-3 1-1 8-7

1-2 3-3 6-5 1-0 3-2 1-1 7-6

2-3 3-2 5-4

3-4 2-1 4-3

4-5 1-0 3-2

5-6

2-1 2-2

1-0 2-1 3-2 1-0 2-1 2-1 4-3 1-1 2-1 2-2 4-3 1-0 2-2 3-2 2-1 2-1 1-0 1-0 1-1 8-7 1-1 7-6 2-2 5-4 1-1 6-5 2-1 4-3 1-1 5-4 1-0 3-2 2-1 1-0 1-1 4-3 1-0 3-2 2-1 1-0 8-7 1-0 3-2 1-1 7-6 1-1 6-5 1-1 5-4 1-0 4-3 3-2 2-1 1-0 2-2 4-3 2-1 3-2 1-0 2-1

10

2-1 1-1 6-5

1-0 1-1 5-4 1-1 4-3 2-2 6-5

4-3 1-0 3-2 2-2 5-4

6 Na 8 Na 5 Na

Ta2 10 Ta3 11

C(t) Ta1 D(t) C(t) Ta2 D(t) C(t) Ta3 D(t)

28

Algorithms

Aperiodic constraint

scheduler type

Schedulers periodic aperiodic

periodic aperiodic preemptive criterion Idle time 0 Idle time 0 Da(t) < Dp(t)

aperiodic periodic preemptive criterion

Background scheduling

relative

background

RM

FCFS

no

yes

Idle time = 0

Idle joint scheduling Joint scheduling

relative/strict strict

background background

ED ED

ED ED

no yes

yes yes

Idle time = 0 Da(t) > Dp(t)

Slack Stealing

relative

background

RM

FCFS

yes

L(t)>0

yes

L(t)=0

Pooling Sporadic Sever

relative relative

Server server

RM RM

FCFS FCFS

yes yes

polling polling

yes/no yes/no

polling polling

29

Hybrid task set scheduling Slack stealing


Each time an aperiodic task enters in the system, time for servicing this aperiodic task is made by stealing processing time from the periodic tasks looking for laxity, and then without causing a deadline missing.

Rate Monotonic (2) FCFS (1) If the residual nominal laxities Li(t) of periodic tasks are up to zero (2) Whenever a residual nominal laxity Li(t) of a periodic task goes down to zero.
7-8 1-0 2-2 8-9 9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18 2-2 3-2 2-2 8-7 2-2 2-1 2-2 7-6 2-2 1-0 2-2 6-5 2-1 0-0 2-2 5-4 1-0 0-0 2-2 4-3 2-2 3-2 2-2 3-2 2-1 2-2 2-2 2-1 1-0 2-2 2-2 1-0

(1)

r0 C Tp1 Tp2 Ta1 0 0 4 2

T 5
Tp1

t C(t) L(t) C(t) Tp2 L(t) Ta1 Ta2 C(t) C(t) C(t)

0-1 2-1 3-3 2-2 8-7

1-2 1-0 3-3 2-2 7-6

2-3

3-4

4-5

5-6 2-2 3-2

6-7 2-1 2-2

2 10 2 Na 1 Na 2 Na

2-1 6-6

1-0 6-6 2-1 1-0

Ta2 10 Ta3 11

1-0 3-2 2-1 1-1 1-1 1-0

Ta3

30

Algorithms

Aperiodic constraint

scheduler type

Schedulers periodic aperiodic

periodic aperiodic preemptive criterion Idle time 0 Idle time 0 Da(t) < Dp(t)

aperiodic periodic preemptive criterion

Background scheduling

relative

background

RM

FCFS

no

yes

Idle time = 0

Idle joint scheduling Joint scheduling

relative/strict strict

background background

ED ED

ED ED

no yes

yes yes

Idle time = 0 Da(t) > Dp(t)

Slack Stealing

relative

background

RM

FCFS

yes

L(t)>0

yes

L(t)=0

Pooling Sporadic Sever

relative relative

Server server

RM RM

FCFS FCFS

yes yes

polling polling

yes/no yes/no

polling polling

31

Hybrid task set scheduling Pooling server


The pooling server becomes active at regular intervals equal to its period and serves the aperiodic tasks within its capacity. If none aperiodic task is waiting, the polling server suspends itself until the beginning of its next period, and releases time to periodic tasks. r0 C Tps Tp1 Tp2 Ta1 0 0 0 4 2 2 T 5 10
t Tps Tp2 Tp1 Ta1 Ta2 Ta3 0-1 2-0 2-1 1-0 3-2 2-1 1-0 2-2 2-1 1-0 1-2 2-3 3-4 4-5 5-6 2-1 6-7 1-0 7-8

Rate Monotonic (2) FCFS (1) Whenever the server starts its period with aperiodic task(s) waiting for him. (2) If the server ends its capacity, or none aperiodic task is waiting
8-9 9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18 18-19 2-1 2-2 1-0 2-2 2-1 1-0 2-0

(1)

3 20 2 Na 1 Na 2 Na

1-0 2-1 1-1 1-1 1-1 1-0

Ta2 10 Ta3 11

32

Hybrid task set scheduling Sporadic server


The sporadic server preserves its capacity until an aperiodic task occurs. When it processes a set of task as first time (at t0) it must wait a time equals to Ts (its period) to replenish its capacity. A count down R(t) can be computed like R (t ) = t0 + Ts t r0 C Tps Tp1 Tp2 Ta1 0 0 0 4 2 2 T 5 10
Tps R(t) Tp2 Tp1 Ta3 Ta4 t C(t) 0-1 2-2 2-1 1-2 2-2 1-0 3-2 2-1 1-1 2-1 1-1 1-0 1-0 2-3 2-2 3-4 2-2 4-5 2-1 5-4 5-6 1-0 4-3 6-7 0-0 3-2

Rate Monotonic (2) FCFS (1) Whenever the server starts its period with aperiodic task(s) waiting for him. (2) If the server ends its capacity, or none aperiodic task is waiting
7-8 0-0 2-1 8-9 0-0 1-0 9-10 10-11 11-12 12-13 13-14 14-15 15-16 16-17 17-18 2-2 2-1 5-4 2-2 1-0 4-3 2-2 0-0 3-2 2-1 0-0 2-1 1-0 0-0 1-0 2-1 5-4 1-1 4-3 1-1 3-2

(1)

3 20 2 Na 1 Na 2 Na

1-0 2-1 1-1 1-1 1-1 1-0

Ta2 10 Ta3 11

Ta5

33

Vous aimerez peut-être aussi