Task Systems

For interesting schedulability problems, a set of tasks needs to be contained within a task system. RealTimeScheduling provides such a type, which is a fairly thin wrapper around a standard Vector.

Generating Task Systems

Task systems can be generated at random using common algorithms from the real-time literature. This is useful for conducting schedulability studies.

RealTimeScheduling.randtasksystemFunction
randtasksystem([tasktype=PeriodicImplicitTask{Float64}], U::Real,
               utilization_dist::Univariate, period_dist::Univariate)

Generate a random TaskSystem with utilization at most U. Tasks are drawn one at a time with utilizations drawn from utilization_dist, and periods from period_dist. The task system is returned once the next task generated would cause its utilization to exceed U.

source

Testing Properties of Task Systems

As with individual tasks, it can be useful to check if all tasks in a task system are implicit or constrained deadline.

It's just as easy to compute the utilization or density of a task system, as well as its hyperperiod.

Additionally, it's often a sensible check to verify that a task system is feasible before doing other tests on it.

RealTimeScheduling.feasibleMethod
feasible(T::AbstractRealTimeTaskSystem, m::Integer=1)

Test whether the real-time task system T is feasible on m processors, i.e. its density is at most m.

source

Task Priority

For fixed-priority (FP) scheduling, RealTimeScheduling uses an implicit model of task priority, whereby the index of a task in a given TaskSystem is its priority. Lower indices are considered higher priority, as is usually the case in the literature.

We provide two functions to sort a TaskSystem in order of increasing period and relative deadline.

Time-Demand Analysis

Many schedulability tests make use of time-demand analysis (TDA). To support this, the common demand bound function (DBF) and request bound function (RBF) are implemented for task systems.

Using the RBF, the package provides an implementation of TDA for uniprocessor fixed-priority task systems.

RealTimeScheduling.schedulable_fixed_priorityFunction
schedulable_fixed_priority(T)

Check if the AbstractRealTimeTaskSystem T is schedulable by a fixed priority scheduler, with tasks prioritized by index (low to high).

Examples

Lehoczky's counterexample to use of traditional TDA when deadlines exceed periods:

julia> ts = TaskSystem([PeriodicTask(70, 70, 26), PeriodicTask(100, 118, 62)]);

julia> schedulable_fixed_priority(ts)
true

Shortening the deadline of task 2 makes the system unschedulable:

julia> ts[2] = PeriodicTask(100, 116, 62);

julia> schedulable_fixed_priority(ts)
false
source