1 / 14

d024: Finish Time in Big Harmonic Periods

d024: Finish Time in Big Harmonic Periods. Shang-En Huang Team Dont Block Me, National Taiwan University March 26, 2010. Problem Description ( 1/3). There are period task in a task set. For the - th task: Execution time ei : The time needed in one period.

iola-pratt
Download Presentation

d024: Finish Time in Big Harmonic Periods

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. d024: Finish Time in Big Harmonic Periods Shang-En Huang Team Dont Block Me, National Taiwan University March 26, 2010

  2. Problem Description (1/3) • There are period task in a task set. • For the -th task: • Execution time ei : The time needed in one period. • Period pi : The task must be done in every pi time.

  3. Problem Description (2/3) • We say the periods in a task set is harmonic if for every two tasks Ti and Tj with periods pi < pj , then is a multiple of . • Rate-monotonic scheduling: The task with shorter period have higher priority to be executed.

  4. Problem Description (2/3) • In this problem, the periods in each task set is harmonic and is distinct. • Find the finish time of the task with the largest period using rate-monotonic scheduling.

  5. Example • There are four tasks: • Task 1: need 1 unit in every 2 units. • Task 2: need 1 unit in every 4 units. • Task 3: need 3 units in every 16 units. • Task 4: need 1 units in every 32 units. Answer: 16

  6. A Naïve Method • Simulate by time. • Time complexity . • Each can be as large as . Time Limit Exceeded

  7. Observation (1/2) • Use the fact that the periods are harmonic. • We can sort the tasks by their periods first. • Consider first m tasks only, then the total execution time is fixed in every unit time. • We will know how many time will “reserved” for next task. (The property of rate-monotonic scheduling.)

  8. Observation (2/2) • How to calculate this for first tasks? • In first units of time,task occupied units of time. • Just add them all! • Now, back to the problem: How to find the last execution time for a certain task?

  9. Key to Solution (1/3) • For task , it can use the time only when all the previous tasks are done. • If we want to finish the -th task, then we have to find out the -th “idle time”. • Do adivisionto find the period of -th taskwhere -th “idle time” occurs. How?

  10. Key to Solution (2/3) • Suppose we have “idle time” in every time. • So in the example below, the time we want to findis equal to the -th idle time in time.

  11. Key to Solution (3/3) • But we haven’t count in all ’s execution time. • Therefore the actual “idle time” we need isthe -th “idle time”. • Do this recursively! (By a for-loop is fine.)

  12. The Algorithm • First we check if it is schedulable or not. • Namely, if then it is schedulable. • Then, calculate idle time . • Let , . • For down to 1 do: • Find a period of we want, say -th. • Let .The next idle time we want to find. • Let . • Finally the answer is .

  13. Analysis • We can calculate the idle time of one by one, with total effort . • The total running time is .

  14. Finally… Thanks for your attention!

More Related