90 likes | 237 Views
Quantitative Evaluation of Embedded Systems. Buffering. Buffering in streaming applications. Image taken from an online tutorial on the VLC media player. Buffering in dataflow graphs. A. C. B. 30ms. S. 10ms. 26ms. Invariants in a periodic schedule.
E N D
Buffering in streaming applications Image taken from an online tutorial on the VLC media player
Buffering in dataflow graphs A C B 30ms S 10ms 26ms
Invariants in a periodic schedule • Determine the MCM and choose a period μ ≥ MCM • For each actor a initialize a start-time Ta := 0 • Repeat for each arc a—i—b : Tb := Tb max (Ta + Ea – iμ)until there are no more changes • Repeat for each actor a:Ta:= min{all arcs a-i-b} (Tb - Ea+ iμ)until there are no more changes • Delayed latency ≤ Toutput+ Eoutput + δ·μ - Tinput Tb≥ Ta+ Ea – iμ i≥ (Ta - Tb + Ea) / μ
Retaining the invariant when buffering t0 = 0ms A C B t0 = 34ms t0 = 8ms S 30ms i ≥ (Ta – Tc + Ea)/μ 10ms μ = 22ms 26ms
Retaining the invariant when buffering t0 = 0ms A C B t0 = 34ms t0 = 8ms S 30ms i ≥ (Ta – Tc + Ea)/μ i≥ δ 10ms μ = 22ms 26ms
Retaining invariant => retaining MCM By definition of periodic schedule we findfor every arc x-#-y that Ty ≥ Tx+ Ex– # μ Adding these steps over a path B-X-Y----Z-A we find that TA≥ TB+ E(B-X-Y---Z) – #(B-X-Y---Z-A)μ And so we find that i ≥ (TA - TB + EA)/μ ≥ E(B-X-Y---Z-A) / μ– #(B-X-Y---Z-A) Which means for the cycle mean on the newly created cycle B-X-Y----Z-A-B: E(B-X-Y---Z-A) / (#(B-X-Y---Z-A) + i) ≤ μ A B i
Retaining MCM => retaining invariant Reversely, assume that we pick i so that the MCM of the graph does not change. Then for any cycle B-X-Y----Z-A-B we know: E(B-X-Y---Z-A) / (#(B-X-Y---Z-A) + i) ≤ μ By definition of periodic schedule we havefor every arc x-#-y that Tx ≤ Ty - Ex + # μ Adding these steps over a path B-X-Y----Z-A we find that TB≤ TA - E(B-X-Y---Z) + #(B-X-Y---Z-A)μ And so: (TA - TB + EA)/μ ≤ E(B-X-Y---Z-A) / μ– #(B-X-Y---Z-A) ≤ i A B i
How large should a buffer be? A C B S i But be aware of δ… if and only if the periodic schedule stays unchanged if and only if the MCM stays unchanged