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

Gespeichert in:
Bibliographische Detailangaben
Titel: ANON: A Cooperative Multitasking Scheduler in Source Code for Teaching and Implementing Concurrent or Real-Time Software
Autoren: Frank Vahid, Bailey Miller, Tony Givargis
Quelle: CoED. 14
Verlagsinformationen: American Society for Engineering Education, 2024.
Publikationsjahr: 2024
Beschreibung: Embedded systems often implement multiple concurrent tasks of varying priority through the use of a real-time operating system (RTOS). However, an RTOS may introduce overhead, complexity, and maintenance issues. For embedded system applications whose tasks don't heavily compete with one another, an alternative approach is to write the tasks to be cooperative: For each call to the task, the task runs quickly, and then returns so other tasks can execute. For such cooperative tasks, a programmer may then write their own task scheduler in the application's course code like C. However, no common approach exists, and thus embedded programmers sift through myriad online articles and examples, many of which discuss but do not provide scheduler code, provide code only for same-period cooperative tasks, or provide code that is rather complex to learn. To remedy this situation, we introduce scheduler code designed to be ultra-simple to learn and use for the most common cases of cooperative multitask applications. The scheduler code, called RIOS (Riverside/Irvine OS), is written in C but that can be implemented in languages like C++, Java, Python, Javascript, etc. RIOS can be copy-pasted directly into a project's source code, and modified as desired. Via aggressive simplification over several years, the base scheduler code has fewer than 30 lines in C. We describe the core features of RIOS. We also summarize college class experiences with 70+ students showing most students could extend RIOS for various purposes, such as an extension to enable/disable any task (100% success among students), switch tasks between two periods (98% success), add a priority field and sort by priority (94% success), and calculate utilization and jitter (65-70% success). RIOS is used by dozens of universities to teach real-time software concepts to thousands of students, and is used by hundreds of embedded systems engineers in practice.
Publikationsart: Article
ISSN: 2577-221X
DOI: 10.18260/b13b-8d-97610
Dokumentencode: edsair.doi...........87bf13b469c2d64027dab8d0b341d35f
Datenbank: OpenAIRE
Beschreibung
Abstract:Embedded systems often implement multiple concurrent tasks of varying priority through the use of a real-time operating system (RTOS). However, an RTOS may introduce overhead, complexity, and maintenance issues. For embedded system applications whose tasks don't heavily compete with one another, an alternative approach is to write the tasks to be cooperative: For each call to the task, the task runs quickly, and then returns so other tasks can execute. For such cooperative tasks, a programmer may then write their own task scheduler in the application's course code like C. However, no common approach exists, and thus embedded programmers sift through myriad online articles and examples, many of which discuss but do not provide scheduler code, provide code only for same-period cooperative tasks, or provide code that is rather complex to learn. To remedy this situation, we introduce scheduler code designed to be ultra-simple to learn and use for the most common cases of cooperative multitask applications. The scheduler code, called RIOS (Riverside/Irvine OS), is written in C but that can be implemented in languages like C++, Java, Python, Javascript, etc. RIOS can be copy-pasted directly into a project's source code, and modified as desired. Via aggressive simplification over several years, the base scheduler code has fewer than 30 lines in C. We describe the core features of RIOS. We also summarize college class experiences with 70+ students showing most students could extend RIOS for various purposes, such as an extension to enable/disable any task (100% success among students), switch tasks between two periods (98% success), add a priority field and sort by priority (94% success), and calculate utilization and jitter (65-70% success). RIOS is used by dozens of universities to teach real-time software concepts to thousands of students, and is used by hundreds of embedded systems engineers in practice.
ISSN:2577221X
DOI:10.18260/b13b-8d-97610