当前位置:网站首页>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
边栏推荐
- Stock problems 5 times
- Summary: Prometheus storage
- 物企大变局时代,SRM供应商采购系统助力企业打造物业采购数字化标杆
- IIC读写EEFPROM
- Linux系统彻底删除Mysql
- GBase 8c 注释信息函数
- Gbase 8C backup control function (I)
- How tormenting are weekly and monthly reports? Universal report template recommended collection! (template attached)
- Gbase 8C backup control function (III)
- 递归的使用:1.将平铺数组转为树 2.将树转化为平铺数组
猜你喜欢

HCIP第十二天笔记

硬件SPI与软件模拟SPI速率对比

Unity 通用红点系统

Prediction of charitable donation behavior by EEG multivariate model analysis

Real time synchronization and conversion of massive data based on Flink CDC

Qlib tutorial - based on source code (II) local data saving and loading

物企大变局时代,SRM供应商采购系统助力企业打造物业采购数字化标杆

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

暴雪《暗黑破坏神 4》PS5 / PS4 测试版添加到 PlayStation 数据库

Zhi Huijun, Huawei's "genius youth", has made a new work, building a "customized" smart keyboard from scratch
随机推荐
N32L43x Flash读\写\擦除操作总结
Machine learning how to achieve epidemic visualization -- epidemic data analysis and prediction practice
The petrochemical industry is facing the tide of rising prices, and the digital dealer distribution system platform enables dealers and stores
Lambda expressions and stream streams
石油化工行业迎战涨价大潮,经销商分销系统平台数字化赋能经销商与门店
Use of recursion: 1. Convert the tiled array to a tree 2. Convert the tree to a tiled array
爬虫学习的一个综合案例——访问网站
Gbase 8C transaction ID and snapshot (IV)
Leetcode: 515. Find the maximum value in each tree row
C language · pointer
2022软件测试技能 Robotframework + SeleniumLibrary + Jenkins web关键字驱动自动化实战教程
Gbase 8C transaction ID and snapshot (V)
硬件SPI与软件模拟SPI速率对比
Simplicity for beauty - programming ideas
Favorite songs
VLAN实验
企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建
Interview question 01.07. rotation matrix
面试官:你确定Redis是单线程的进程吗?
HCIP第十五天