In real-time OS environments, you often face the problem that you must guarantee that code runs on a fixed schedule. For instance. you can get a function that gets exactly every 10 milliseconds. Not earlier, not later.
To guarantee such strict time limits, you need to write code that should not block the critical time code under any circumstances.
You cannot use posix synchronization primitives here. You should never block a mutex or aqurie semaphore from a critical time code, because another process / thread may already block it. However, often you are allowed to unblock another thread from a critical time code (for example, freeing a semaphore in order).
In such environments, message queues are a good choice for data exchange because they offer a clean way to transfer data from one stream to another without blocking.
, . , .
, . , , , . .