Advantages and disadvantages with Static- and Dynamic Scheduling
Asked Answered
L

3

7

I'm opening this questions since I can't find easy to understand summarized information about this topic. There isn't even a good youtube-video that explains this.

I'm currently studying realtime programming and statical- and dynamical scheduling is a part of it. I just can't seem to get my head around it.

If there is someone who can explain the advantages and disadvantages with statical- and dynamical scheduling in a educational way, that would really be helpful.

What I've got so far is the following:

  1. Statical scheduling: Is a off-line approach where a schedule is generated manually. It can be modified during run-time, but isn't suggested because it then can cause the threads to miss it's deadlines. It's easy to implement and to analyze. Because it's easy to analyze it's easy to see if the system is going to make all of its deadlines.

  2. Dynamical scheduling: Is a on-line approach where the schedule is generated automatically. It can be modified during run-time by the system and it should't cause (in most cases) the threads to miss its deadlines. If the system changes it's easy to generate a new schedule since it's automatically generated. There isn't a guarantee that the system meets all its deadlines.

Anyone that can explain these two a bit better than me? Or perhaps add more information about these two. Perhaps illustrate it with a image so it'll be easier to wrap my head around it.

Ladykiller answered 16/10, 2016 at 11:9 Comment(3)
what do you mean by educational way??Squeak
@SupunWijerathne Haha, thanks google translate... It's a word we use in Sweden. But what I mean is "in a easy-to-understand-way".Ladykiller
I am actually good in English, just wonder what you actually expected. :))Squeak
S
11

In simple terms,

Static Scheduling is the mechanism, where we have already controlled the order/way that the threads/processes are executing in our code (Compile time). If you have used any control(locks, semaphores, joins, sleeps) over threads in your program (to achieve some goal), then you have intended to use static (compile time) scheduling.

Dynamic Scheduling is the mechanism where thread scheduling is done by the operating systems based on any scheduling algorithm implemented in OS level. So the execution order of threads will be completely dependent on that algorithm, unless we have put some control on it (with static scheduling).

I think the term 'advantages' would not be the best term here. Simply when you are implementing any control over threads with your code to achieve some task, you should make sure that you have used minimal controls and also in most optimized way. :))

Addition:

Comparison between Static & Dynamic Scheduling

Generally we would never have a computer program which would completely depend on only one of Static or Dynamic Scheduling.

Instead we would have some programs which are pretty much in controlled from the code itself (Strongly static). This would be a good example for that.

And some programs would be strongly dynamic (weakly static). This would be a good example for that. There you might see other than the start of 2 threads, rest of the program execution would be a free flyer.

Please don't try to find a disclaimer criteria which would seal a program either a strongly static or strongly dynamic one. :))

Positives & Negatives

  • Dynamic Scheduling scheduling is faster in execution than static scheduling, since it's basically a free flyer without any intentional waits, joins etc. (any kind of synchronization/protection between threads).

  • Dynamic Scheduling is not aware of any thread dependencies (safeness, synchronization etc.). If you followed above sources I mentioned, you would probably have the idea.

  • So generally, how good multi-threading programmer you are, would depend on how limited restrictions, dependencies, bottlenecks you have implemented on your threads yet to achieve your task successfully. :))

I think I have covered quite a things. Please raise me questions if any. :))

Squeak answered 17/10, 2016 at 13:55 Comment(4)
Good explanation. "Advantages" might have been a poor choice of word, but do you mind adding some sort of list of positives/negatives between static- and dynamic scheduling to your answer? :)Ladykiller
sure I'll add some description and let u know, as soon as time permits. :))Squeak
Sorry for the slow reply. I've been working the whole week. But yes, the addition to your previous answer was of great help! Thank you very much :)Ladykiller
nice to see :)) (Y) (Y)Squeak
S
0

Dynamic Scheduling –

o Main advantages (PROs): - Enables handling cases of dependence unknown at compile time - Simplifies compiler - Allows compiled code to run efficiently on a different pipeline

o Disadvantages (CONs): - Significant increase in hardware complexity - Increased power consumption - Could generate imprecise exceptions

Shortcake answered 18/6, 2018 at 23:41 Comment(0)
P
0

During Static scheduling the order of the thread or processes is already controlled by the compiler . So it occurs at the compile time. Here if there is a data dependency involving memory then it wouldn't be solved or recognised at compile time therefore the concept of Dynamic scheduling was introduced .

Dynamic scheduling also determines the order of excecution but here the hardware does this rather than the compiler.

Pappas answered 14/4, 2019 at 12:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.