| Contents | Index |
Embedded Coder/ Embedded Targets/ Operating Systems/ Embedded Linux
Simulink Coder/ Desktop Targets/ Operating Systems/ Linux
This documentation will be updated.
![]()
Use this block to create a task function that spawns as a separate Linux thread. The task function runs the code of the downstream function-call subsystem. For example:

This documentation will be updated.

Assign a name to this task. You can enter up to 32 letters and numbers. Do not use standard C reserved characters, such as the / and : characters.
Select the scheduling policy that applies to this thread. You can choose from the following options:
SCHED_FIFO enables a First In, First Out scheduling algorithm that executes real-time processes without time slicing. With FIFO scheduling, a higher-priority process preempts a lower-priority process. The lower-priority process remains at the top of the list for its priority and resumes execution when the scheduler blocks all higher-priority processes.
For example, in the following image, task2 preempts task1. Then task3 preempts task2. When task3 completes, task2 resumes. When task2 completes, task1 resumes.

Selecting SCHED_FIFO, displays the Thread priority parameter, which you can set to a value from 1 to 99.
SCHED_OTHER enables the default Linux time-sharing scheduling algorithm. You can use this scheduling for all processes except those requiring special static priority real-time mechanisms. With this algorithm, the scheduler chooses processes based on their dynamic priority within the static priority 0 list. Each time the process is ready to run and the scheduler denies it, the operating system increases that process's dynamic priority. Such prioritizationhelps the scheduler serve the SCHED_OTHER processes in the correct order.
Selecting SCHED_OTHER, hides the Thread priority parameter, and sets the thread priority to 0.
When you set Thread scheduling policy to SCHED_FIFO, you can set the priority of the thread from 1 to 99 (low-to-high).
Higher-priority tasks can preempt lower-priority tasks.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |