---
title: "#53 Priority-based scheduler for the \"superloop\" architecture"
url: https://daily.dev/posts/53-priority-based-scheduler-for-the-superloop-architecture-jcu8zy1ot
source_url: https://www.youtube.com/watch?v=VzgOqOSPS1o
type: video:youtube
source: "Quantum Leaps"
published: 2026-05-31T07:45:29.385Z
updated: 2026-05-31T07:57:40.979Z
tags: ["embedded"]
reading_time: 18
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# #53 Priority-based scheduler for the "superloop" architecture

**[Quantum Leaps](https://daily.dev/sources/quantum-leaps)** · 18 min read · 0 upvotes · 0 comments

## Summary

This lesson from the Modern Embedded Systems Programming Course covers building a priority-based non-preemptive scheduler within the superloop architecture. Starting from a simple bitmask-based ready set, the scheduler is generalized to support up to 32 tasks via a task registry array. Priority numbering is revised to use intuitive higher-number-equals-higher-priority ordering. The scheduling loop is optimized using the ARM CLZ (count leading zeros) instruction for constant-time task selection. The scheduler is then refactored into a dedicated module (sch.c/sch.h) with a clean API (sch_start, sch_run, sch_post). The lesson also discusses the run-to-completion task model and its constraints, setting the stage for event-driven active objects in the next lesson.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=VzgOqOSPS1o>

---

Tags: [#embedded](https://daily.dev/tags/embedded)

[View this post on daily.dev](https://daily.dev/posts/53-priority-based-scheduler-for-the-superloop-architecture-jcu8zy1ot)
