Sławomir Kozok
Sławomir Kozok

Reputation: 141

Is FreeRTOS (and other RTOS'es) also a framework

As we know FreeRTOS is a real-time operating system.

For example, if we take explanation from wiki:

Framework.

FreeRTOS has something we may call "inversion-of-control" - FreeRTOS controls all the tasks implemented by programmer. Also FreeRTOS is extensible. The problem with this definition is when we take "non-modifiable framework code" - FreeRTOS is deployed mainly as source code for user project - you can modify it.

Is FreeRTOS a framework? And are there better definitions for frameworks?

Upvotes: 0

Views: 864

Answers (1)

Miro Samek
Miro Samek

Reputation: 1975

No, FreeRTOS, as most other RTOS kernels, is just a toolkit, not a framework. This is because you need to write the body of each task, typically as an endless loop. You then decide which RTOS blocking mechanisms (semaphores, time-delays, event-flags, etc.) to use to "throttle" the execution of your task body.

In a framework, you typically would not do this. The framework would provide the body of your tasks and would also provide the blocking mechanism. For example, a framework might structure every task as an event loop (a.k.a. "message-pump") with a message queue. Then the framework will call your code to handle every event. This is how the inversion of control (a defining characteristic of a framework) comes about.

Please note that an RTOS can be used as a component of a framework, but an RTOS itself is not a framework.

Upvotes: 3

Related Questions