Upcoming SlideShare
×

# Mmclass9

• 9 views

MULTIMEDIA AND SYSTEM DESIGN

MULTIMEDIA AND SYSTEM DESIGN

More in: Engineering , Technology
• Comment goes here.
Are you sure you want to
Be the first to comment
Be the first to like this

Total Views
9
On Slideshare
0
From Embeds
0
Number of Embeds
0

Shares
0
0
Likes
0

No embeds

### Report content

No notes for slide
• If the start time for Ti is 0 the j-th subtask is scheduled at times (j-1)m, (j-1).m+Pi, (j-1)m+2Pi …So tasks j and k will be scheduled together iff (j-1)m mod Pi = (k-1)m mod Pi

### Transcript

• 1. A Partitioning Algorithm • Let Ti be a task in T such that Pi ≤ Pj for all tasks Ti in T • S1 = {Ti}, T = T - {Ti}, For i=2..g, Si = φ • For i=2..g • For every task Tl in T • max[Tl] = gcd(S1 ∪ {Tl}) – Σ w over all Tk in (S1 ∪ {Tl}) • For j=2..i-1 – max[Tl] = max{max[Tl] , gcd(Sj ∪ {Tl}) – Σ w over all Tk in (Sj ∪ {Tl})} • Let Tl be a task in T such that max[Tl] ≤ max[Tk] for every Tk in T • Si = {Tl}, T = T - {Tl} • For every Ti in T • For j=1..g • Slack[Sj] = gcd(Sj ∪ {Tl}) – Σ w over all Tk in (Sj ∪ {Tl}) • Add Ti to the subset Sj for which Slack[Sj] is maximum
• 2. Scheduling for Horizontal Striping • Assume wi stripe units for supervideo Vi is stored on disk 0 • The Problem • Schedule non-preemptible tasks T1…Tr with periods P1…Pr on q processors; each task Ti has wi subtasks, with compute time of 1; interval between consecutive subtasks is m • If a task has P=4, w=3 and m=6 is it schedulable? • Condition for subtasks of a single task Ti to be schedulable on a single processor: • For all 1 ≤ j, k ≤ wi, j ≠ k, ((j-1).m) mod Pi ≠ ((k-1).m) mod Pi • Why? • What is the corresponding algorithm to test
• 3. Testing for Schedulability • Procedure is_schedulable({T1..Tn},m) • Let g=gcd(P1..Pn) • Take g time units 0..(g-1) that are not assigned • Sort the tasks in decreasing order of wi • For each task Tiin the sorted order • j=0 • while (j < g) – if for k=0…(wi – 1), time unit (j+k.m) mod g is free • for k=0…(wi – 1), assign time unit (j+k.m) mod g to Ti • exit while – else j=j+1 • If j=g return FAIL • return {(Ti, x): 1 ≤ i ≤ n and the first subtask of Tiis
• 4. Scheduling for Horizontal Striping • Algorithm schedule_tasks_2 [Ozden 97] • R=is_schedulable({T1…Tn},m) • If R=FAIL • Let gcd(P1...Pn,)=g • If g=1, return FAIL • Let T1…Tn be tasks with periods P1/g…Pn/g and w1…wn subtasks. • Partition the tasks into g subsets S1…Sg. • For i=1..g, let Ri= schedule_tasks_2(Si,m/g) • If for any i Ri= FAIL, return FAIL, else return {(Ti, x.g+(j-1)): 1 ≤ j ≤ g and (Ti,x) ∈ Rj} • Return R
• 5. Example • Tasks T1, T2, T3 with periods 6,8,8 have two subtasks each. The interval between them is 4. • Try the algorithm.
• 6. Example • Tasks T1, T2, T3 with periods 6,8,8 have two subtasks each. The interval between them is 4. • Try the algorithm.