From the course: Introduction to FreeRTOS and Basic Task Management

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

The concept of a thread

The concept of a thread

- [Instructor] In this lesson, we are going to talk about threads. In the context of an RTOS, a thread is the smallest unit of execution that the RTOS scheduler manages. You'll often hear threads referred to as tasks. The terms can be used interchangeably, but what exactly does a thread do? A thread represent a sequence of executable instructions that can run concurrently with other threads. Each thread carries out its specific task, sharing resources, such as CPU, memory, IO ports, with other threads. Here we have three threads: Thread 1, Thread 2, and Thread 3. All sharing the same CPU, RAM, and other resources. The RTOS scheduler is responsible for managing which thread gets access to the CPU and other resources at any given moment, ensuring that all threats are given time to execute their instructions. Now let's see the various states of a thread. In simple terms, a thread can exist in three main states. We have the ready state, the run state, and the suspend state. Each of these…

Contents