Scheduling

RealTimeScheduling implements a simple yet flexible scheduling simulator supporting preemptive global job-level fixed priority scheduling of TaskSystem structs. It also supports generating plots of the resulting schedules using the Plots.jl package.

using RealTimeScheduling, Plots
T = TaskSystem([PeriodicImplicitTask(3, 2), PeriodicImplicitTask(3, 2), PeriodicImplicitTask(3, 2)])
s = schedule_gedf(T, 2, 30.)
plot(s, size=(600, 300))
Example block output
RealTimeScheduling.schedule_globalFunction
schedule_global(release!, T, m, endtime; kill=false, pass_schedule=false)

Simulate a preemptive global schedule of task system T on m processors to the specified endtime. When releasing a job, the function release!(job) is called, allowing arbitrary modifications to be made, enabling a wide variety of global schedulers to be implemented. Three examples are provided: schedule_gfp, schedule_gedf, and schedule_gfl.

The job provided to release!(job) defaults to being released as early as possible (i.e. at time 0 or one period after the task's last job), and has the relative deadline and cost specified by the task. The priority defaults to the task's index in T, with lower priority values being treated as higher priority by the scheduler.

If kill is true, jobs are killed at their deadline if they have not yet completed.

If pass_schedule is true, the release! function is passed a second argument containing the schedule up until the job's release.

source
RealTimeScheduling.schedule_gedfFunction
schedule_gedf(T, m, time; kill=false)

Simulate a preemptive global earliest-deadline-first (GEDF) schedule of task system T on m processors for the specified time.

If kill is true, jobs are killed at their deadline if they have not yet completed.

See also schedule_global for more general global scheduling.

source
RealTimeScheduling.schedule_gflFunction
schedule_gfl(T, m, time; kill=false)

Simulate a preemptive global fair lateness (GFL) schedule of task system T on m processors for the specified time. This provides the lowest tardiness bounds of any GEDF-like scheduler under compliant vector analysis; for more information, see Erickson, "Managing Tardiness Bounds and Overload in Soft Real-Time Systems." DOI: 10.17615/fvp3-q039.

If kill is true, jobs are killed at their deadline if they have not yet completed.

See also schedule_global for more general global scheduling.

source
RealTimeScheduling.schedule_gfpFunction
schedule_gfp(T, m, time; kill=false)

Simulate a preemptive global fixed priority (GFP) schedule of task system T on m processors for the specified time. Tasks are prioritized by their index in T, lowest index first.

If kill is true, jobs are killed at their deadline if they have not yet completed.

See also schedule_global for more general global scheduling.

source

Concrete Jobs

Schedule objects contain a Vector of Vectors of AbstractJob objects. These contain all the parameters of a concrete real-time job: release, deadline, cost, and priority, as well as a Vector of ExecInterval objects.

RealTimeScheduling.JobType
Job{S}(release::S, deadline::S, cost::S, priority::S, exec::Vector{ExecInterval{S}}

A real-time job with the given parameters, executing over the intervals in exec.

source
RealTimeScheduling.JobOfTaskType
JobOfTask{S, T}(task::T, release::S, deadline::S, cost::S, priority::S, exec::Vector{ExecInterval{S}}

A real-time job of the given task with the given parameters, executing over the intervals in exec.

source
RealTimeScheduling.ExecIntervalType
ExecInterval{S}(start::S, stop::S, proc::Int)

Interval type for job execution, with a specified processor index. Always assumed to be half open, i.e., [start, stop).

source