Report
10 months, 1 week ago.

Running thread and code in main -- what is priority of code in main?

In this example https://os.mbed.com/docs/latest/apis/rtos.html one thread is explicitly declared and there is some other code running in main. This code in main obviously has some priority by default. Is it normal? Is it realtime?

Comment on this question

1 Answer

10 months, 1 week ago.

Hello Dan,

According to the RTOS overview "The function main is a special thread function that is started at system initialization and has the initial priority osPriorityNormal; it is the first thread the RTOS schedules.". In the Thread constructor the priority defaults to osPriorityNormal. On the same page you can also find the priority values available in mbed (a quite long list).