Deterministic Context Switching in Real-Time Schedulers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional schedulers assume negligible context switch times, leading to drift in scheduling periodicity and inaccurate prediction of time slices, which affects the guaranteed time access for processes in computing environments.

Innovation Solution

A method for deterministic context switching that determines fixed time slices and switch durations, ensuring each time slice and switch duration is completed in full to maintain schedule periodicity, using a MILS kernel scheduler and high-resolution timers to manage latency and faults.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If context switch time is assumed negligible to optimize scheduling functionality, then device complexity is reduced, but scheduling precision deteriorates due to drift in periodicity

Engineering Contradiction:
Improvescheduling functionality complexityVSAvoidscheduling periodicity accuracy
Core Design Contradiction:
Device complexityVSManufacturing precision

Solution Approach 1:

The patent applies preliminary action by pre-calculating and allocating a specific time interval for context switching in advance, rather than assuming it negligible. The scheduler determines a fixed time slice that includes both process execution time and context switch time, ensuring the context switch completes within the predetermined time window before the next process begins. This prevents drift in scheduling periodicity while maintaining deterministic timing.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If instructions are executed out of order to optimize processor utilization, then productivity is improved, but reliability deteriorates due to non-constant context switch time

Engineering Contradiction:
Improveprocessor utilizationVSAvoidcontext switch time consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent applies dynamics by allowing the processor to execute instructions out of order dynamically during the context switch interval, while maintaining the deterministic boundary that the context switch must complete by the end of the predetermined time slice. The scheduler dynamically manages the time slice allocation to accommodate out-of-order execution benefits while ensuring the context switch completes within the fixed time window, thus maintaining reliability.

Inventive Principle:
Principle #15Dynamics

3Reliability

If time slice is extended to include context switch time, then reliability is improved by guaranteeing process time, but loss of time increases as context switch time is stolen from process execution

Engineering Contradiction:
Improveprocess time guaranteeVSAvoidprocess execution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies segmentation by dividing the time slice into distinct segments: one segment for process execution and another segment for context switching. The scheduler allocates a predetermined time slice that is segmented to ensure the context switch occurs within a specific portion of the time slice, guaranteeing that the process receives its full allocated execution time while also accommodating the necessary context switch duration without stealing time from process execution.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8997111B2System and method for deterministic context switching in a real-time scheduler
Publication Date: 2015.03.31 WIND RIVER SYSTEMS INC
  • US8997111B2 patent drawing
  • US8997111B2 patent drawing
  • US8997111B2 patent drawing

AI summary

A system and method deterministically switches context in a real-time scheduler to guarantee schedule periodicity. The method includes determining a time slice for each of the plurality of processes. The method includes determining a time slice switch duration between consecutive ones of the time slices. The method includes determining a starting point for each time slice. The method includes generating a schedule as a function of the time slices, the time slice switch durations, and the starting points of the time slices. The schedule includes an order for each of the time slices for a respective one of the plurality of processes. Each of the time slices and each of the time slice switch durations are required to run for their entire duration to guarantee a periodicity of the schedule.