Options
All
  • Public
  • Public/Protected
  • All
Menu

Deadline based scheduler implementation, based on Scheduler implements EDF scheme

Hierarchy

Index

Constructors

constructor

Properties

NPCS

NPCS: boolean

Flag indicates a non-preemptive critical section

RTJS_BUDGET

RTJS_BUDGET: number

Number of preemption points that are visited before thread must actually call yield

config

mostly constant configuration options for the scheduler

Optional currentTask

currentTask: TaskState

the currently running task

Protected forceReschedule

forceReschedule: boolean

This flag forces the scheduler to reschedule immediately, before finishing the current timeslice.

printTimes

printTimes: boolean

schedulerTime

schedulerTime: number = 0

How long was the scheduler active on the executor

Private taskQueue

taskQueue: PriorityQueue<TaskState> = new PriorityQueue((a: TaskState, b: TaskState) => {return b.absoluteDeadline > a.absoluteDeadline})

queue used for managing the tasks, sorted by the deadline-member of the task structures

Accessors

numberOfTasks

  • get numberOfTasks(): number

paused

  • get paused(): boolean

Methods

addAlarm

  • addAlarm(fn: function, delay: number, periodic?: boolean): TimeoutState
  • Add a single-short or periodic alarm function.

    Parameters

    • fn: function

      The function to be callled after the delay has passed

        • (): void
        • Returns void

    • delay: number

      The deay in miliseconds

    • Default value periodic: boolean = false

      Whether the alarm is enqueued again

    Returns TimeoutState

addTask

  • add a task to the queue of the scheduler, sends a scheduler-message to event queue after it is finished, if no task is running atm

    Parameters

    • task: Task

      the task object to enqueue

    • Optional parent: TaskState

      optional parameter, scheduler-structure for the parent task if any

    Returns void

Protected debug

  • debug(msg: any, ...optionalParams: any[]): void
  • print messages to stdout if the ''debug'' flag was set

    Parameters

    • msg: any
    • Rest ...optionalParams: any[]

    Returns void

emptyTaskQueue

  • emptyTaskQueue(): void

enqueueTask

Protected executeTimelice

  • executeTimelice(): void

Protected getNextTask

needsReschedule

  • needsReschedule(): boolean

pause

  • pause(): void

Protected prepareNextTask

  • prepareNextTask(): void

repostMe

  • repostMe(): void

resume

  • resume(): void

spawnTask

  • spawnTask(task: Task): void
  • Used by tasks to spawn new tasks, sets the currently running one as the parent

    Parameters

    • task: Task

      the child task

    Returns void

Generated using TypeDoc