Description
Algorithms
The Scheduling Algorithms are:
- DM
- Deadline Monotonic. The tasks having lesser deadlines have highest priorities.
- RM
- Rate Monotonic. The tasks having lesser periods have highest priorities.
- Audsley++
- All combinations of possible priorities are checked. For n tasks, there are factorial n possible priority orders.
- EDF
- Earliest Deadline First. The task having its deadline before the other ones is executed first (actually, the "plus" function is not applied here, all tasks having to be scheduled in parallel).
In the present version, the only proposed scheduling algorithm is just RM (Rate Monotonic). The other ones will be provided in future versions.
Constraints
One of the possible constraints of a given scenario is the preemption cost: if a task is preempted (i.e. has to suspend its execution due to other tasks or contraints), a certain number of time units are added when the task restarts, representing the processor cost due to the preemption (typically the context switching).
Other constraints include:
- precedence
- strict periodicity
- non preemptiveness
- latency
Command
The main command is taskadd. It takes the scenario as parameter, either in a file or in a string.
Usage: taskadd [options] filename-or-string -q Quiet: no output; exit 0 if schedulable, 1 if not -s Argument is task string instead of input file name -help Display this list of options
The result is the displaying of the scheduled scenario, step by step, the tasks being displayed according to their number (the first one being "1") and in colour. The times units corresponding to preemption costs are displayed in reverse video.
It is followed by the displaying of the FRT (First Response Time) and the WRT (Worst Response Time).
The exit status of the command can be:
- 0: the scenario is schedulable
- 1: the scenario is not schedulable
- 2: a syntax error occurred
If the "-q" (quiet) option is provided, the scheduled scenario is not displayed.
If the "-s" option is provided, the scenario is described in the command line (it is no more a file name) with the same syntax (see below) where newlines can be replaced by slashes ("/").
Syntax
A scenario file contains the description of all tasks with the possible constraints they have.
The first line contains the global cost of the preemption. If no cost, its value must be 0.
Each of the following lines contain a task descriptions, one task by line with:
- release time: a positive or negative number.
- duration: a non-zero positive number.
- deadline (optional): a non-zero positive number.
- period: a non-zero positive number.
If the deadline is not present, its value is equal to the value of the period.
Example
A test file:
$ cat test.dm 2 0 2 8 1 1 6 24 1 4
Execution:
$ taskadd test.dm t1: rel 0 dur 2 dea 8 per 8 t1: {11......} (rel 0) t2: rel 1 dur 1 dea 6 per 6 t2: {2.....} (rel 1) t3: rel 24 dur 1 dea 4 per 4 t3: {3...} (rel 24) tasks priorities: t3 t2 t1 t3 = {3...} (rel 24) t3 ⊕ t2 = 2.....2.....2.....2.{...32..3..23} (rel 1) t3 ⊕ t2 ⊕ t1 = 12¹¹1..211...2..11.2.{...32113..2311.32..31123} (rel 0) r = 12¹¹1..211...2..11.2.{...32113..2311.32..31123} (rel 0) FRT 5 1 1 WRT 5 1 1
Short version (option "-q"):
$ taskadd -q test.dm FRT 5 1 1 WRT 5 1 1
Short version and scenario in a string:
$ ./taskadd -q -s "2/0 2 8/1 1 6/24 1 4" FRT 5 1 1 WRT 5 1 1
Exit status ("0" since the scenario is schedulable):
$ echo $? 0