Asee peer logo

ANON: A Task Scheduler in Source Code for Teaching and Implementing Concurrent or Real-Time Software

Download Paper |

Conference

2022 ASEE Annual Conference & Exposition

Location

Minneapolis, MN

Publication Date

August 23, 2022

Start Date

June 26, 2022

End Date

June 29, 2022

Conference Session

Computers in Education 3 - Modulus I

Page Count

14

DOI

10.18260/1-2--40421

Permanent URL

https://peer.asee.org/40421

Download Count

514

Request a correction

Paper Authors

biography

Frank Vahid University of California, Riverside

visit author page

Frank Vahid is a Professor of Computer Science and Engineering at the University of California, Riverside, since 1994. He is co-founder and Chief Learning Officer of zyBooks, which creates web-native interactive learning content to replace college textbooks and homework serving 500,000 students anually. His research interests include learning methods to improve college student success especially for CS and STEM freshmen and sophomores, and also embedded systems software and hardware. He is also founder of the non-profit CollegeStudentAdvocates.org.

visit author page

author page

Bailey Miller University of California, Riverside

author page

Tony Givargis University of California, Irvine

Download Paper |

Abstract

We describe the design and decade-long use of an approach for executing concurrent tasks on a microprocessor without the need for a real-time operating system. We wrote a lightweight non-preemptive task scheduler, called RIOS. The task scheduler is written in C, but that can be implemented in languages like C++, Java, Python, Javascript, etc., rather than in assembly as is commonplace. As such, RIOS can be copy-pasted directly into a project's source code, and modified as desired. The scheduler code includes a structure to hold features of a periodic task like its period and elapsed time since previous execution, an array to hold all tasks, a technique for using a timer and interrupt-service routine (ISR) to keep time, and code to actually call each task at the appropriate time. We describe the core features of RIOS, and its successful usage in embedded systems courses, enabling students to build powerful concurrent-tasks systems correctly and quickly. Students can extend RIOS to further learn real-time concepts, such as including a deadline per task, or creating alternative scheduling algorithms such as rate monotonic, earliest-deadline-first scheduling, or round-robin scheduling. Students can also add functionality to analyze task execution behavior, such as calculating processor utilization or task jitter. As such, students can learn first-hand how the scheduler piece of a real-time operating system operates. Via aggressive code rewriting and minimization over several years, we reduce RIOS's entire code size to just a few dozen lines. RIOS is currently used by dozens of universities to teach real-time software concepts, reaching thousands of students per year. RIOS is also used by hundreds of practicing embedded systems engineers as well, resulting in faster implementation time and much smaller code size than the alternative of linking in a real-time operating system. RIOS is downloadable for free at https://www.cs.ucr.edu/~vahid/rios/.

Vahid, F., & Miller, B., & Givargis, T. (2022, August), ANON: A Task Scheduler in Source Code for Teaching and Implementing Concurrent or Real-Time Software Paper presented at 2022 ASEE Annual Conference & Exposition, Minneapolis, MN. 10.18260/1-2--40421

ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2022 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015