How to Choose RTOS Queues, Semaphores, Mutexes, and Event Groups
RTOSes provide many synchronization primitives: queues, semaphores, mutexes, event groups, and task notifications. They can all appear to mean “make one task wait for another”, so they are easy to mix up.
That may work briefly, but field failures become hard to reason about:
- events are occasionally lost
- a high-priority task is delayed by a low-priority task
- a full queue stalls the system
- ISR code calls an API that can block
- combined conditions are checked incorrectly
- data is updated, but the consumer sees stale state
The first selection model is:
Read More