Most of today’s embedded real-time operating systems (RTOS) use the same scheduling method i.e. a priority based task switching algorithm. This means that the task with the highest priority that is ready to run is the one getting the CPU time. A more interesting aspect of scheduling is the strategies that are used to put the tasks into ready state. Two dominating techniques are used by RTOS of today’s embedded systems: time-triggered and event-triggered. Actually, the time-triggered strategy is a special case of the event-triggered strategy, but its heavy use within the automotive and control industry has categorized it as a strategy of its own.
Event-triggering is the most commonly used strategy in network applications. Most often an external event trigger a task to start executing, for instance when a PDU arrives an event triggers a router task to execute in order to define where the PDU should be sent. In automotive ECU:s this strategy is often used in gateway applications i.e. ECU:s that send CAN, LIN or Flexray packets between different networks in the car or truck.
In a time-triggered system it is the system clock that triggers the execution of a certain task. This type of execution is suitable for powertrain and control applications using regulators in its application loop, for instance fetching new samples from the ADC every 20 ms to get a good filtering algorithm. The time-triggered strategy can be combined with a deadline scheduling algorithm where the task with the earliest deadline gets to execute. A benefit of the time-triggered strategy is that all tasks execute in a scheme independent of external events. The consequence of this is that the CPU load is more or less constant, making profiling and load measurements easy to perform. This gives a more robust system design.
The two strategies described above can be combined to create a mixed system. The most common mix is to add time-triggered tasks to event-triggered systems since these systems often need to execute some tasks periodically, for example sending a heartbeat CAN-frame every 20 ms. Adding event-triggers to time-triggered systems are more rare since this kind of mixed system will loose the benefits of the stable CPU-load of a pure time-triggered system.