Nicholas Khorasani

Computer Engineer | Software Engineer

Cyclic Executive Scheduler for Real-Time Systems

April 2024

TLDR

  • Wrote a tiny C library that runs a cyclic executive: precomputed frames and minor cycles, no surprises at runtime.
  • Simple API: declare periodic, sporadic, and aperiodic tasks, pick a frame size, give the schedule table, hit run().
  • Built-in slack handling and a small queue so sporadic work doesn’t starve; aperiodic runs when there’s room.
  • Designed for embedded targets where predictability beats fancy dynamic schedulers.

Project Overview

This is a lightweight “cyclic executive” framework in C. Instead of a full preemptive RTOS, you pick a frame size that divides your task periods, lay out a repeating table of which task runs in which slot, and let the executive loop drive it. The main benefit to this approach is timing is predictable, analyzable, and easy super easy to verify.

You register tasks with periods and worst-case times, provide a schedule (minor cycles inside a major cycle), and the executive enforces it. There’s a small queue for sporadic jobs, and aperiodic work only runs when you’ve got slack. This is a super effective scheduler for embedded systems for predictable performance.

Full Report

📄 Project Report (PDF)

What I Learned

  1. Writing performant, minimal, embedded APIs means budgeting every byte.
  2. Precomputed schedules shine when you have known Worst Case Execution Time (WCET) and you need predictable behavior.

Contributions and Acknowledgements

Designed and implemented by Nicky Khorasani as an independent project for ECE 455: Embedded Systems at the University of Waterloo.