Embedded System Software

AnimOS CPU-Scheduling


A project by Gregor Kotainy and Prof. Dr.-Ing. Olaf Spinczyk, 2014


Definition

  • Operate
  • Help
Scheduling strategy:



Strategy options:
Option nameOption value

Chapter 1: Definition

Section 1: Process definition

By taking a closer look at the content of the operation tab, you'll find a box, where you can specify processes for being scheduled.
You have got several options which may assist you.

Subsection 1.1: Define a new process

To create a new process, you have to fill out its attributes in the table footer.
You can navigate through the attribute input fields using ENTER or TAB. Please note, that there are unique and normal attributes.
You can distinguish them by color in the table header. Always you have to keep track not to define unique attributes repeatedly,
because you will get an error message. The name attribute of a process defines it seed for range burst attributes in the simulation.
If you wish to consider another scenario, you'll have to alter it a little bit. (e.g. rename "Process1" to "Process1a")
After you are done, finish it with ENTER on the last field or a click on the button.
The newly defined process will be created, appended to the table and then activated automatically.

Subsection 1.2: Activating and deactivating a process

The process status can be seen in the definition table, where means an active and means an inactive process.
Toggle the status by simply clicking on it. The benefit is, that you don't need to delete processes to test another scenarios.
Sometimes it stays impossible to activate a process, because there can be strategies with additional attributes required.
These attributes may be undefined on some processes and have to be set first.

Subsection 1.3: Changing the process order

Changing the process order may have different effects to your schedule. Most of the algorithms are designed to schedule the topmost process first,
when they arrived or got ready at the same time. You can achieve this by just dragging the process and dropping it at the right position.

Subsection 1.4: Editing a process

Editing is a simple task. All you have to do ist to double click the position you want to change which creates a text field
at the same position where you can adjust the value. Then you are allowed to use TAB or KEY-UP and KEY-DOWN
to navigate through the other values.

Subsection 1.5: Delete a process

To delete an existing process, you just need to click on the button and confirm the deletion with accepting the popup message with Yes.
Another way is to hold down the CTRL key while clicking on the button.

Section 2: Selection of the scheduling strategy

Subsection 2.1: Selecting a strategy

You can select a scheduling strategy by simply clicking the drop-down list and then selecting one.

Subsection 2.2: Strategy options

Some of the scheduling strategies allow to set up some custom options. (For example: "Round Robin" allows to change the time slice)
You just have to insert another value and apply it with a click on Save and apply. A tool-tip error message will appear, if the value is invalid.

Subsection 2.3: CUSTOM (User defined) strategy

This section allows you to implement your completely own strategy. All you have to do is to click on Edit source wich will bring up the source editor.
By default it will show you an example code of a mixed "First-Come First-Served" / "Round Robin" strategy, which will run 100 ticks each.
After you did your adjustments, you have to click on Apply to run your code.
You will just have access to the JavaScript basics, but not to the DOM of the website.

Simulation

  • Operate
  • Help

Chapter 2: Simulation

Section 1: Navigation in the Gantt chart

The initial thing you will see in the plot are the defined processes on one axis and the ticks of simulation on the other axis.
When the scheduling strategy works correctly, you will see a yellow vertical bar hovering the first (0) tick.
There is at least one case, where it can break when u use the CUSTOM strategy and you are not returning a value.
In this special case, navigation is impossible.
In any other cases you can just use the navigation panel below or point with your mouse on the tick you want to jump to.

Subsection 1.1: Using the navigation panel

The easiest thing is to press on the play button. After you have done this, you will see the yellow bar moving right.
The schedule simulation will be revealed tick by tick and can be stopped using the button at any time.
The next pair of buttons are the single step buttons and . They will move just a single step.
They are useful for education purpose, where you want to try to predict what happens next.
The next ones are for seeking an interesting point, where a state of at least one process changes.
They are working backward and forward like in the previous case.
Of course it is possible to jump to the beginning or to the end of simulation, where everything will be revealed.

Subsection 1.2: Resetting the simulation

The whole simulation can be reset using the button.
Any revealed content will disappear and the bar will move back to the first tick.

Statistics

  • Operate
  • Help

Chapter 3: Statistics

Section 1: Meaning of the table entries

Remove statistics: To remove created statistics, just click on the X next to the column you wish to remove
Scheduling strategy: The scheduling strategy you selected from the drop-down list above
Scheduling options: The scheduling options for the selected scheduling strategy
Global metrics
Process count: Number of active processes, which take part in this schedule
Busy CPU time: Number of 'ticks', where the CPU is busy
Idle CPU time: Number of 'ticks', where the CPU is idle
Processor utilization: Percentage of busy CPU state
Fair schedule: A fair schedule indicator for this special case. A schedule is fair, when the CPU percentage of each process corresponds the mean CPU percentage with no more deviation than 68%. No process should suffer starvation.
Turnaround time mean: Mean time of the interval of time between the submission of processes and their completion. Includes actual execution time plus time spent waiting for resources, including the processor.
Turnaround time standard deviation: Standard deviation of the turnaround time mean
Waiting time mean: Mean time of processes spending time on waiting for resources, including the processor.
Waiting time standard deviation: Standard deviation of the waiting time mean
Response time mean: Mean time from the submission of requests until the responses begin to be received.
Response time standard deviation: >Standard deviation of the response time mean
Per process metrics
Active processes: The named processes which are defined and activated
Arrival: An attribute from the process definition, which indicates the tick of process arrival
CPU burst: An attribute from the process definition, which indicates the number of ticks a process is busy
IO burst: An attribute from the process definition, which indicates the number of ticks a process does io
Priority: An attribute from the process definition, which indicates the process priority (just for Fixed Priority strategy; use the definition order in other cases)
Turnaround time mean: Mean time of the interval of time between the submission of a process and its completion. Includes actual execution time plus time spent waiting for resources, including the processor.
Turnaround time standard deviation: Standard deviation of the turnaround time mean
Waiting time mean: Mean time of each process spending time on waiting for resources, including the processor.
Waiting time standard deviation: Standard deviation of the waiting time mean
Response time mean: Mean time from the submission of a request until the response begin to be received.
Response time standard deviation: Standard deviation of the response time mean
CPU percentage: CPU percentage of each process

Section 2: Example

For a better explanation of the metrics "turnaround time", "waiting time" and "response time" you might consider the following setup:

Example: Process definition

For example using "Round Robin" scheduling strategy, the simulator will produce the corresponding Gantt chart:

Example: Process definition

Now take a closer look at the highlighted Process2.

Subsection 2.1: Turnaround time

To determine the turnaround time, you need find out how long it took (in ticks), to process the whole burst.
In this example you can see, that Process2 started on tick 1 and finished its round on tick 8.
The turnaround time is then calculated with 8 - 1 = 7.
Once again, the process is ready on tick 11 and finishes on tick 21, so the turnaround time is 21 - 11 = 10.
Try it for the rest and check your results using AnimOS console output on statistics creation.

8 - 1 = 7, 21 - 11 = 10, ...

Subsection 2.2: Waiting time

To get the waiting times of Process2, you are going to sum up all ticks within one turnaround where the process is in ready state.

(1 - 1) + (7 - 3) = 4, (14 - 11) + (20 - 16) = 7, ...

Subsection 2.3: Response time

You have calculated the response times to get the waiting times in the previous case, but now its important,
how long it takes to get the process scheduled when its ready.

1 - 1 = 0, 7 - 3 = 4, 14 - 11 = 3, 20 - 16 = 4, ...

Privacy Policy | Imprint