FreeRTOS task, thread and process

I am trying to understand the meanings of words like ‘task,’ ‘thread,’ and ‘process’ in the world of FreeRTOS. I have gone through the user documents for FreeRTOS, and I think a ‘task’ is code that runs in its own private memory address space. However, I don’t see any difference between a task and a thread. I hope someone can correct my understanding if I am on the wrong track

The terms “Process” and “Thread” apply to “big” operation systems, and are not used in describing FreeRTOS (except maybe as a comparison). A process is a program that runs in its own private memory space, isolated by the OS from other processes (except for things specifically shared between them). A process will have threads within it (maybe just one, or maybe multiple) that all run within that processes memory space.

A FreeRTOS Task is mostly like that thread, with the whole application being something like a process. Tasks mostly share memory space, but tend to restrict themselves as to what they access, not forced by the OS, but enforced by the programmer to help keep the program manageable. On some processors, there is a MPU that allows the programmer to make some tasks “restricted” which does limit what they can access by the hardware, and some processor have a “secure” area that non-secure tasks can’t access.

Thank you, I’ve been looking several FreeRTOS sample codes, and I’ve noticed that multiple tasks can be created within a program. However, I’m a bit puzzled because I don’t see term process in code or how there could be more than one thread in a process. Could you clarify what’s process in practical view point?

FreeRTOS doesn’t have something called a “Process”. You have processes in “big” OSes, like Windows or Linux. A process then becomes basically, a program that you run, that might have other programs running around it, that it interacts with through limited communication channels. Each process is keep isolated from the others, so they can’t interfere with each other. When a process starts, it has one thread, but it can tell the OS to start addition threads, and gives the OS a function to call to start that thread on, and after that point, both threads will be running in parallel, using the same memory space (but separate stacks).

You can sort of think of a full FreeRTOS program as representing a single process, but there isn’t an OS outside it running it, but there is FreeRTOS INSIDE it that is providing the ability to create multiple tasks. This is part of the difference between a Task and a Thread. A Thread is created and controlled by the OS OUTSIDE the process, (from a request by the process) using code/data from within the address space of that process. A Task is created by the FreeRTOS program using the kernel that is INSIDE the program to create the multiple paths of execution (sometimes also called threads of execution).