当前位置:网站首页>Synchronization control between tasks
Synchronization control between tasks
2022-07-03 09:52:00 【0725 you Guangchuan】
Synchronization control between tasks
- vxWorks Semaphores provide inter task communication 、 Sync 、 And mutually exclusive optimal choice
1.1 Synchronization refers to the coordination of multiple tasks in the execution order , Make sure it doesn't
Now there are errors related to time , In this case, the semaphore represents the waiting event , Initially, semaphores are not available , A task or interrupt handler releases the semaphore to notify the occurrence of this event , Once unblocked , The task executes the corresponding event to handle the program , It should be noted that the state of the semaphore used for synchronization should initially be empty , A task first waits for the semaphore released by other tasks .
Insert a code chip here
The execution sequence between tasks is described as follows :
SEM_ID semSync;
semErrorSync=semBCreate(SEM_Q_FIFO,SEM_
EMPTY);/* Create a semaphore that displays alarm information */
semNewErrorSync=semBCreate(SEM _Q_FIFO,
SEM_EMPTY);/* Create a semaphore that displays new alarm information */
taskErrorCheck(void){
···/* First display the error message */
semGive(semErrorSync);
semGive(semNewErrorSync);
}
}
`taskErrorDispCircle(void){
`semTake(semErrorSync,WAIT_FOREVER);
semTake(semNewErrorSync,WAIT_FOREVER);
···;/* Cycle the display of alarm information */
}
because semErrorSync and semNewErrorSync Of first beginning value Unavailable , If the task taskErrorDispCircle() First execution will inevitably block , Only in the task taskErrorCheck() After execution semGive() After the operation , send 2 After semaphores are available , Mission taskErrorDispCircle() To execute .
`
边栏推荐
- Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
- SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
- Uncle Wang's blog directory [constantly updating]
- How does the nr-prach receiver detect the relationship between prembleid and Ta
- Leetcode daily question (745. prefix and suffix search)
- CEF download, compile project
- numpy. Reshape() and resize() functions
- 要选择那种语言为单片机编写程序呢
- Leetcode daily question (2090. K radius subarray averages)
- Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 5 --blinker_ MIOT_ MULTI_ Outside (lighting technology app + Xiaoai classmate control socket multiple jacks)
猜你喜欢

UCI and data multiplexing are transmitted on Pusch - placement of data and UCI positions (Part III)
![[CSDN] C1 training problem analysis_ Part IV_ Advanced web](/img/ee/2e9756cc0e2e6eda83e1b2304c0bd6.png)
[CSDN] C1 training problem analysis_ Part IV_ Advanced web

MySQL data manipulation language DML common commands

一个可执行的二进制文件包含的不仅仅是机器指令

Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from

Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?

UCI and data multiplexing are transmitted on Pusch (Part V) -- polar coding

要選擇那種語言為單片機編寫程序呢

【22毕业季】我是毕业生yo~

STM32 interrupt priority management
随机推荐
STM32 serial communication principle
Qt QComboBox QSS样式设置
Raspberry pie installation SciPy
单片机职业发展:能做下去的都成牛人了,熬不动就辞职或者改行了
我想各位朋友都应该知道学习的基本规律就是:从易到难
[CSDN]C1训练题解析_第二部分_Web基础
要选择那种语言为单片机编写程序呢
Fundamentals of Electronic Technology (III)__ Chapter 6 combinational logic circuit
Development of fire power monitoring system
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 3 --blinker_ MIOT_ Light (lighting technology app control + Xiaoai classmate control)
Leetcode daily question (2232. minimize result by addressing parents to expression)
Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
Idea remote breakpoint debugging jar package project
Leetcode daily question (1856. maximum subarray min product)
SSB Introduction (PbCH and DMRs need to be supplemented)
Leetcode daily question (745. prefix and suffix search)
Install local sources using yum
Quelle langue choisir pour programmer un micro - ordinateur à puce unique
STM32 serial port usart1 routine
UCI and data multiplexing are transmitted on Pusch - placement of data and UCI positions (Part III)