English-language podcasts

The Embedded Frontier

#029 - How to Write Fast RTOS Code

35 min

Listen through the publisher, then discuss the episode here or arrange an in-person Roundtable. Your city determines where to meet.

Roundtables are designed for groups of four, with a shared subject and room for everyone to speak. Come for discussion, with no dating expectation.

Jacob Beningo talks with RTOS pioneer Bill Lamie, creator of Nucleus, ThreadX, and PX5 RTOS, about how to write efficient, high-performance real-time code. They cover POSIX pthreads, keeping software simple, RTOS benchmarking, test-driven development, using AI as a development teammate, and practical tips for structuring RTOS applications. Key Takeaways: • Keep it simple: complexity is the biggest enemy of embedded software, and a complex solution is probably not the right one. • Minimize nested function calls in critical paths, since pushing and popping registers and return addresses is expensive. • Design for performance from the start. Every comparison and data reference matters in the real-time path, and performance can't be bolted on at the end. • Use an error-checking veneer selectively. Enable it for new or untrusted code and call the direct API for proven code to save cycles. • Standardizing on the POSIX pthreads API makes it easier to share code between Linux and RTOS-based products and to move between RTOSes. • Write documentation before code to keep your design flexible and expose interfaces that are hard to explain. • Adopt test-driven development by writing test cases before the code. This keeps you from writing unreachable paths and makes coverage targets such as 100% statement and branch coverage achievable. • Treat AI as a teammate, not a replacement. It excels at tedious tasks like proofreading, QA, concurrency review, and quick hardware lookups, but it isn't reliable for pure code generation. • Put as many threads as possible at the same priority and use higher priorities only when preemption is absolutely necessary. • Use a minimalist number of threads and system objects to reduce accidental RTOS overhead. Links: • PX5 RTOS (https://px5rtos.com/) • Bill Lamie on LinkedIn (https://www.linkedin.com/in/bill-lamie-1619a24) • 2026 RTOS Performance Report (https://www.beningo.com/rtos-performance-report/) • Eclipse ThreadX (https://threadx.io/) • Why RTOS Functional Safety Certification Matters (https://www.beningo.com/why-rtos-functional-safety-certification-matters/) • RTOS Best Practices Course (https://www.beningo.com/courses/rtos-best-practices/)

Episode information is provided by the publisher. Listening takes place on the publisher’s service.

Listen at the source ↗

Featured places to meet in Palo Alto, CA

Explore these places and arrange a conversation through ThinkMatch.

City guide for Palo Alto, CA

More from The Embedded Frontier

The Embedded Frontier

#028 - From Coding Assistants to Autonomous Engineering

26 min

Jacob Beningo explores the shift from using AI as a coding assistant to agentic firmware development, where AI agents autonomously build, debug, test, and verify embedded systems. He shares a real experiment using an NXP MCX N947 board and an AI-written I2C driver. He also covers hardware safety guardrails, simulation, and how embedded engineers can evolve into systems engineers. Key Takeaways: • Most teams use AI only as a coding assistant. The bigger gains come from agentic workflows where AI builds, debugs, tests, and verifies firmware. • AI doesn't get firmware right on the first try, and neither do human engineers. It needs the ability to iterate, as with test-driven development. • Connecting an AI agent to real hardware or a simulator lets it observe results, find root causes, and fix problems instead of guessing. • In the I2C experiment, the agent correctly diagnosed a hardware problem (a backwards click board) that the engineer had wrongly blamed on the software. • Once the boa

Discuss this episode

Community Poll

Governments should remove practical barriers to voting, even when doing so costs more.

Share your view, then see how readers voted. No sign-in required. This poll is shared across stories.

Do you agree or disagree?

Choose one answer

Common Quandary

A Common Quandary to discuss

Another conversation to explore, separate from this news story.

Your new television goes on sale elsewhere. Can you return it and buy the identical one cheaper?

A week after buying a television, another store offers the same model for much less. Your retailer refuses to match the price but allows unopened-looking returns. You could carefully repack the perfectly functional set.

Is a generous return policy permission to reverse a deal for any reason?

Explore this quandary