This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is there any good way to "synchronize low speed threads with high speed threads"?

Hi everyone, happy new year!
I have a RTX V5 thread flag related issue:
In my program, TaskA needs to wake up TaskB frequently under certain circumstances. TaskB is a low-speed device (LED blinks). In this case, what adverse effects does TaskA frequently call osThreadFlagsSet?
I always feel that this is not very good. Is there any good way for you to "synchronize low speed threads with high speed threads"? Thank you !

Code show as below:

Note: TaskA has higher priority than TaskB.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void TaskA (void *argument)
{
static uint32_t flags;
while(1)
{
// Alarm generated every 10ms
flags = osThreadFlagsSet(ThreadIdTaskB, 1);
osDelay(10);
}
}
void TaskB (void *argument)
{
static uint32_t flags;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0