# Basics

**RTOS uses a preemptive scheduler to allocate system time(CPU) between different tasks , so that the OS switches these tasks one after another creating an illusion of parallelism. Task switching can create overhead as well as priority inversion needs to be taken care in RTOS**

1. **Task scheduling :** The process by which a task or function is scheduled along with a priority, so it can be executed
2. **Idle task :** A task that executes when no other tasks are active, example : led indication can be done, logging can be done etc.
3. **Priority inversion :** When a low priority task blocks a resource being required by a high priority task, i.e. high priority task behaves like a low priority task&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://amriths-harijayanthan.gitbook.io/notes/freertos-rtos/basics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
