8 years, 10 months ago.

Which kind of scheduler is used in mbed RTOS?

I'm running a simple program with 3 threads that print a message on execution. However I would like to know which kind of scheduler does the RTOS library uses as when I set priorities for the threads, I get different results that I don't expect. I use the same period for all threads, if I use the default priority for all threads I get a result which resembles a rate monotonic scheduler, however if I set different priorities, the result differs a lot and I can't decipher which planner is used. Could someone with experience using the library enligthen me? Thanks a lot.

Question relating to:

posted by Sistemes Encastats i Ubics FIB 29 Oct 2015

2 Answers

8 years, 5 months ago.

I presume that scheduler uses priority based scheduling (at any given time, the processor executes the highest priority task) and round robin when the threads have the same priority.

Note 1: Rate Monotonic Algorithm is a procedure to set the priority of the treads. The scheduler is not involved on how to find the best priority assignment among threads.

Note 2: Be careful using printf function, because it is a very blocking function (no task switching will occurs during its execution)

8 years, 5 months ago.

if you mean this https://developer.mbed.org/users/mbed_official/code/mbed-rtos/ https://developer.mbed.org/handbook/RTOS

then there are only 7 priority to choose from. It is a preemptive scheduler and more info can be found from http://www.keil.com/pack/doc/CMSIS/RTX/html/index.html http://www.keil.com/rl-arm/kernel.asp

although there are differences from the Keil impl vs mbed.

now if you mean this https://www.mbed.com/en/development/software/mbed-os/ well, it is not an RTOS at all, IMHO.