Академический Документы
Профессиональный Документы
Культура Документы
October 2012
Javier D. Orozco
Depto. de Ingeniera Elctrica y Computadoras
Universidad Nacional del Sur - CONICET
Baha Blanca, Argentina
e-mail: jadorozco@gmail.com
II.
I.
INTRODUCTION
99
i 1 q
t
t q +1 = C i + C j
j =1 T j
October 2012
(1)
III.
A. Event Graphs
B. Events
IV.
A. System state
100
October 2012
TABLE I
EVENT EXECUTION PRIORITIES
Event
Priority
Initialization (v0)
EndSimulation (v5)
Finalization (v3)
Preemption (v4)
Arrival (v1)
Execution (v2)
0
1
2
3
4
5
t + Ti
Ti t
Ti
11 =
D. Edges
The events v0 through v4 are connected by six edges, as
shown in Figure 1. The edges are:
e01: Schedule the arrival of the first job of each task (ji,1
for i = 1 .. n).
e11: Schedule the next event v1 (Arrival).
e12: Schedule a new event v2 (Execution).
e23: Schedule a new event v3 (Finalization).
e24: Schedule a new event v4 (Preemption).
e32: Schedule a new event v2 (Execution).
FIGURE I
FINAL EVENT GRAPH MODEL
G. Event execution
In this section we present the modifications to the system
state (S) that each event performs when executes. These are
the functions fi for each vi event.
The v0 event (Initialization) schedules the tasks initial
jobs. So the first v1 event of each task is programmed from v0.
The simulation clock is also initialized, generally with t = 0.
Any other activity that should be done at setup time (i.e.
worst case response time analysis) is performed at this event.
The v1 event (Arrival) adds a new job ji,k to the scheduler
ready queue. Then it schedules a new v1 event for the next
task job ji,k+1 adding (t + 11, v1(ji,k+1)) into . Finally if the
edge condition c12 is met, a v2 event (Execution) is scheduled
for that instant, (t, v2).
In order to perform the simulated execution of the highest
priority job at the ready queue, the method or routine that
implements the simulated scheduler logic should be invoked
at the v2 event execution. If the edge condition c23 is satisfied,
then a v3 event (Finalization) is programmed
( (t + 23, v3)). Otherwise, a v4 event (Preemption) is
scheduled, (t + 24, v4).
The execution of a v3 event (Finalization) should change
S in order to indicate the highest priority job termination at
ready queue. Then if the edge condition c32 is valid, a new v2
event should be scheduled at the current simulated time in
order to continue the execution of the other jobs that are at the
ready queue. Similarly, the v4 (Preemption) event invokes the
necessary methods or routines to modify S in order to show
the possible preemption of the current highest priority job.
F. Time delays
A vd event should be scheduled for an instant td t. In the
event graph model this is expressed by associating a time
delay od 0 to each edge eod, such that td = t + od.
101
October 2012
V.
TABLE II
MODEL EXECUTION EXAMPLE
t
Event
Executed job
Ready
queue
v0
v1(j1,0)
j1,0
v1(j2,0)
j1,0, j2,0
v1(j3,0)
j1,0, j2,0,
j3,0
v2
j1,0
j2,0, j3,0
v3
j1,0
j2,0, j3,0
v2
j2,0
j3,0
v3
j2,0
j3,0
v2
j3,0
v3
j3,0
v1(j1,1)
j1,1
v2
j1,1
v3
j1,1
v1(j2,1)
j2,1
v2
j2,1
v3
j2,1
v1(j1,2)
j1,2
IMPLEMENTATION
VI.
VII.
REFERENCES
102
October 2012
103