To achieve this objective the software engineer must first assign a priority to each task. The scheduling policy of the RTOS is
then to simply ensure that the highest priority task that is able to execute is the task given processing time. This may
require sharing processing time "fairly" between tasks of equal priority if they are ready to run simultaneously.
Example:
The most basic example of this is a real time system that incorporates a keypad and LCD. A user must get visual feedback of each
key press within a reasonable period - if the user cannot see that the key press has been accepted within this period the software product will at best be awkward to use. If the longest acceptable period was 100ms - any response between 0 and 100ms would be acceptable. This functionality could be implemented as an autonomous task with the following structure:
Now assume the real time system is also performing a control function that relies on a digitally filtered input. The input must be sampled, filtered and the control cycle executed every 2ms. For correct operation of the filter the temporal regularity of the sample must be accurate to 0.5ms. This functionality could be implemented as an autonomous task with the following structure:
The software engineer must assign the control task the highest priority as:
The next page demonstrates how these tasks would be scheduled by a real time operating system.
Next: RTOS Fundamentals - Real Time Scheduling
Any and all data, files, source code, html content and documentation included in the FreeRTOS distribution or available on this site are the exclusive property of Richard Barry.
See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Richard Barry.