80
K
A
DAK
AMX Timing Control
Figure 5.4-1 illustrates the allocation of processing time to two tasks, B and C. Task B
was created first with a time slice interval of 100 AMX system ticks. Task C was created
later with a time slice interval of 50 AMX system ticks. At time t1, tasks B and C were
both triggered by a higher priority task A which then ended.
Since task B was created first, it executes first. Thereafter, in the absence of an y other
higher priority task activity, the processor is shared by tasks B and C as illustrated.
Task C begins to execute at time t2 when task B's first 100 tick time slice expires. At
time t3, task B ends execution. The processor is immediately given to task C which
continues to execute without further interruption by task B.
┌────────┐ ┌────────┐ ┌──┐
│100 ││100 ││25│
Task B ──────┘ └────┘ └────┘ └────────────
┌────┐ ┌────┐ ┌────────────
│50 ││50 ││>50
Task C ───────────────┘ └────────┘ └──┘
↑↑ ↑
t1 t2 t3
Figure 5.4-1 Simple Time Slicing
Figure 5.4-2 illustrates the effects to be expected if, while tasks B and C are being time
sliced, higher priority task A is invoked and executes to completion within 125 system
ticks.
┌──────────┐
│125 │
Task A ───────┘ └──────────────────────────────────
┌──┐ ┌──────┐ ┌────────┐ ┌──┐
│25││75 ││100 ││25│
Task B ────┘ └──────────┘ └────┘ └────┘ └─────
┌────┐ ┌────┐ ┌─────
│50 ││50 ││>50
Task C ─────────────────────────┘ └────────┘ └──┘
↑↑ ↑
t1 t2 t3
Figure 5.4-2 Interrupted Time Slicing