Skip to main content

DetSched

The supported real-time scheduling models are shown in the figure. The main challenge to achieve real-time behavior is choosing the right parameters for the different levels of the scheduling hierarchy. Starting from the top, user logic is executed as “green threads”, i.e. as cooperatively (COOP) scheduled used-defined units of workload. This workload is distributed on system threads using an application-level scheduler. These system-threads are then scheduled on the CPU cores using one of the available system-level scheduler. For linux these are SCHED_DEADLINE and SCHED_FIFO. Thus, multiple decisions have to be made, to guarantee determinism for multiple services running concurrently on the same node.

  • Which user logic to run on which green thread
  • How to write the application level scheduling, i.e., the order of units of execution in green threads
  • Which green thread to run on which system-level thread
  • Which scheduling model to use for which system-level thread
  • Which CPU cores a system-level thread is scheduled on
  • Which CPU cores to reserve for real-time workload
  • How to correctly implement event loops based on timers an incoming events
  • How to exchange data between real-time and non-real-time contexts
  • How to write the services, automatically derive scheduling descriptions and configure the real-time scheduling at runtime

These tasks are handled by the detsched module.

Application-Level Scheduling

The application level scheduling mechanism for executing user logic in real-time system threads in DetSched relies on an examination of prevalent processing patterns found in robotics, programmable logic controllers an computerized numerical control machines. The typical processing patterns utilized in this domain is the input process output model. Inputs can be of three types:

  • Timers, for cyclic execution. This is often at least necessary to realize the detection of missing messages
  • Incoming unidirectional messages following the publish-subscribe scheme
  • Incoming bidirectional messages following the request reply scheme

To enhance determinism messages are always read at the beginning of a cycle and sent a the end of a cycle.