当前位置:网站首页>FreeRTOS kernel summary
FreeRTOS kernel summary
2022-07-28 01:58:00 【ViTO_ two thousand and one】
FreeRTOS Kernel summary
1. Dispatch mode
FreeRTOS The scheduling methods of are divided into preemptive scheduling and Coprocessor scheduling
preemptive scheduling :
Related to the status and priority of the task ,Freertos There's a Tick Heartbeat clock , It is every 1ms Enter once Tick Interrupt inside , In the interrupt, the current CPU The register of is pushed into the stack allocated by the task , You will find the task with the highest priority in the ready task list ( If tasks of equal priority , Take turns to execute ), The status of the task is removed from the stack to CPU Register and run .
Coprocessor scheduling
Scheduling occurs when the following three conditions are met :
1. A task function executes a concession function
2. A task function called API
3. The application clearly defines the execution context in interrupts
2. Semaphore
The types of semaphores are divided into binary semaphores and multivalued semaphores according to the number of semaphores , It is often used in applications that control access to shared resources .
3. Mutex semaphore
Mutually exclusive semaphores are mutually exclusive locks , It is divided into ordinary mutexes and recursive mutexes , Apply to multiple mutually exclusive tasks . Pay attention to when using mutually exclusive semaphores , The acquisition of mutually exclusive semaphores must be released , If you don't release , May cause program Deadlock , That is, two tasks acquire the lock owned by each other , Each enters the pending list , Cannot release mutex .
Common mutex : You can only get... Once , Duplicate fetch is invalid .
Recursive mutex : You can get multiple , But the corresponding must be released many times before the right to use can be ceded .
4. Message queue
For data communication between tasks 、 The data transfer , In the operating system , It is dangerous to transfer data directly using global variables , This article talks about the danger of global variables

5. Event flag set
In addition to semaphores, the synchronization between tasks also includes event flag groups , The synchronization of semaphores is usually one-to-one , Sometimes the system needs many to one synchronization , As for the event flag group, you can check the blog about the use of event flag group in this column .
6. Task to inform
A task notification is an event , Suppose a task is blocked waiting for task notification , After sending a task notification to the receiving task, the blocking state of the task will be released .
This summary refers to :https://blog.csdn.net/qq_45396672/article/details/120877303?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165718262116781683971267%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165718262116781683971267&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2blogfirst_rank_ecpm_v1~rank_v31_ecpm-1-120877303-null-null.185v2control&utm_term=free&spm=1018.2226.3001.4450
边栏推荐
猜你喜欢

Flink 在 讯飞 AI 营销业务的实时数据分析实践

企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建

Summary: Prometheus storage

抓包精灵NetCapture APP抓包教程《齐全》

IIC读写EEFPROM

After learning the loop, I came across the problem of writing factorial of N, which caused a series of problems, including some common pitfalls for beginners, and how to simplify the code

Linux系统彻底删除Mysql

Lambda表达式和Stream流
![[interview: concurrent article 28:volatile] orderliness](/img/8d/c4c2ca08d8883e997709d208b7395b.png)
[interview: concurrent article 28:volatile] orderliness

"Do you" want to be a test / development programmer? We strive to sprout
随机推荐
JS数字精度丢失的原因及解决方案
Content bypass sharing
Establishment of elk log analysis system
Graph theory analysis of white matter brain function network: neural markers for classification and prediction of depression
Simplicity for beauty - programming ideas
GBase 8c 备份控制函数(一)
What devices does devicexplorer OPC server support? This article has listed
白质脑功能网络图论分析:抑郁症分类和预测的神经标记
Leveraging the blue ocean of household appliances consumption with "digital channels", the dealer online system enables enterprises to further their business
实时数仓:美团的实时数仓建设实践
Qlib tutorial - based on source code (II) local data saving and loading
Hcip day 15
数据安全与隐私计算峰会-可证明安全:学习
Leetcode high frequency question 128. the longest continuous sequence, which is often tested in interviews with Internet companies
HCIP第十二天笔记
Data warehouse construction - DWS floor
A Tiger's Tale
Redis 5 种基本数据结构
How tormenting are weekly and monthly reports? Universal report template recommended collection! (template attached)
GBase 8c 事务ID和快照(一)