Introduction to Zephyr Part 8: Multithreading | DigiKey
We show you how multithreading can be used to execute multiple tasks concurrently in Zephyr RTOS, improving system responsiveness and efficiency. This tutorial uses a sample program to demonstrate how to blink an LED and print messages to the console simultaneously by creating and managing threads. You'll learn how to define thread stacks, initialize GPIOs, and manage execution with Zephyr's multithreading APIs. You can find a written version of this tutorial here: https://www.digikey.com/en/maker/tuto... The GitHub repository for this course (including solutions to the challenges) can be found here: https://github.com/ShawnHymel/introdu... Learn how Zephyr's threading APIs simplify thread creation and synchronization, making it easy to manage independent tasks. Proper stack allocation ensures stable execution, while Devicetree abstractions allow for portable GPIO configurations. This example serves as a foundation for more complex multithreaded applications. From there, we dive into thread synchronization using mutexes. In a separate example, we show how to handle user input/output via serial terminal to update a variable shared between two threads. Access to the variable is protected via mutex (lock). Finally, we give you the challenge of using Zephyr’s message queue system to pass data between threads. We only scratch the surface of multithreading in these examples. While we touch on priorities, mutexes, and semaphores, multithreading can become complicated very quickly. Zephyr's robust support for multithreading makes it an excellent choice for responsive embedded systems. If you would like to learn more about multithreading concepts and real-time operating systems, we recommend checking out our Introduction to RTOS series: • Introduction to RTOS Part 1 - What is a Re... Official Zephyr documentation: https://docs.zephyrproject.org/latest... Introduction to RTOS: • Introduction to RTOS Part 1 - What is a Re... ESP32-S3-DevKitC: https://www.digikey.com/en/products/d... Maker.io - https://www.digikey.com/en/maker DigiKey’s Blog – TheCircuit https://www.digikey.com/en/blog Connect with DigiKey on Facebook / digikey.electronics And follow us on X: https://x.com/digikey 0:00 Intro 0:56 Thread Demo 11:31 Thread Priority Levels 13:41 Thead Demo Test 18:00 Mutex Demo 30:12 Challenge: Sensor Reading Queue 32:05 Conclusion

Introduction to Zephyr Part 9: Interrupts, Timers, and Counters | DigiKey

Introduction to Zephyr Part 10: Graphics with LVGL and Display Drivers | DigiKey

Zephyr 101 - Thread Control

Introduction to Zephyr Part 11: WiFi and IoT | DigiKey

Introduction to Zephyr Part 1: Getting Started - Installation and Blink | DigiKey

Zephyr Project: RTOS Start-up and Initialization Flow - David Leach, NXP

Zephyr Workqueues: How They Work and Queue - Loic Domaigne, Doulos GmbH

Introduction to Zephyr Part 12: How to Create a Custom Board Definition | DigiKey

Zephyr 101 - GPIOs and PWM

Introduction to the Zephyr RTOS

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker

99% of Developers Don't Get Semaphores

Introduction to Zephyr Part 6: How to Write a Device Driver | DigiKey

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

Introduction to semaphores in C

I Hacked This Temu Router. What I Found Should Be Illegal.

Introduction to Zephyr Part 7: Debugging with OpenOCD and GDB | DigiKey

Introduction to Zephyr Part 3: Kconfig Tutorial | DigiKey

