Mbed OS Scheduler

Hi,
I would like to know what kind of scheduler does mbed_os use.
From the doc, Execution - Program setup | Mbed OS 6 Documentation

  • Preemptive: The scheduler is responsible for picking and running the threads. Preemptive schedulers can use different algorithms:
    • Mbed OS uses priority based round robin.
    • In an algorithm not used in Mbed OS, threads are executed in equal time slots according to their priority.

Is it round robin scheduler on default mbed os? what does the second point mean?

Thank you for your answers!

Hello Mohamed,

Is it round robin scheduler on default mbed os?

Yes, Mbed OS uses priority based round robin by default:

  • Round-robbin means, if there are a number of threads ready to run and they all have the same priority, they will be assigned run time in a round-robin fashion.

  • Priority based means, if a thread with a higher priority becomes ready to run, the RTOS scheduler will de-schedule the currently running thread and start the high priority thread.

what does the second point mean?

It means that in Mbed, the high priority thread will continue to run until it enters a waiting state or until a thread of equal or higher priority is ready to run rather than to be executed in a time slot equal to all threads.

1 Like