THE QUIET QUEUE
FIELD NOTES / ZEPHYR RTOS

Good timing starts with ownership.

Study notes on Zephyr workqueues, sensor samples, and the boundaries between concurrent tasks.

A queue is a shared resource

A workqueue processes handlers on a dedicated thread. Moving work out of an interrupt can simplify the interrupt path, but a long handler still delays later items on the same queue.

Read the Zephyr documentation ↗

Separate acquisition from access

Fetching a sensor sample blocks the calling thread and stores data in the driver. Channel-get reads the stored sample. Treat these as two stages when considering latency and the lifetime of a reading.

Read the Zephyr documentation ↗

Make concurrency explicit

Choose who owns sensor acquisition. Multiple contexts that fetch and get without a locking mechanism can produce undefined behavior. Write down the intended ownership before adding another reader.

Read the Zephyr documentation ↗

About this notebook

A small collection of embedded-systems study notes. These examples are starting points for exploration; check the documentation for your Zephyr release and board.