Originally published on EmbeddedRelated.

Inter-process communication methods comparison table

Part 4 finishes the IPC taxonomy started in Part 3. Mailboxes, queues, counting semaphores, the Observer pattern, and a construct that I call a “marquee” round out the set of mechanisms tasks need to communicate reliably — all implemented without a preemptive RTOS. The article walks through each one in enough detail to implement it, including how to post arbitrary data types and pointers to a mailbox and how to analyze the schedulability impact of adding a queue.

A second major addition is the dispatch queue: an alternative non-preemptive scheduler in which tasks are posted as function pointers to a central queue and executed in EDF (earliest deadline first) order. This is conceptually simple to understand but significantly more challenging to analyze for determining schedulability than any other technique discussed thus far. The tradeoff is that it handles certain difficult task sets that the Superduperloop cannot, which makes it a useful complementary tool.

The article closes with a full summary of the four-part series — what schedulability analysis tells you, when the Superduperloop suffices, when to reach for one of the off-the-shelf cooperative schedulers from Part 3, and when a preemptive RTOS is actually justified. The core takeaway: the RTOS should be the last tool you reach for, not the first.

Additional Resources

Read the full article →