The Directed Acyclic Graph (DAG) task model for real-time scheduling finds its primary practical target in Robot Operating System 2 (ROS 2). However, ROS 2's publish/subscribe API leaves DAG precedence constraints unenforced: a callback may publish mid-execution, and multi-input callbacks let developers choose topic-matching policies. Thus preserving DAG semantics relies on conventions; once violated, the model collapses. We propose the Function-as-Subtask (FasS) API, which expresses each subtask as a function whose arguments/return values are the subtask's incoming/outgoing edges. By minimizing description freedom, DAG semantics is guaranteed at the API rather than by programmer discipline. We implement a DAG-native scheduler using FasS on a Rust-based experimental kernel and evaluate its semantic fidelity, and we outline design guidelines for applying FasS to Linux Linux sched_ext.
翻译:实时调度中的有向无环图(DAG)任务模型在机器人操作系统2(ROS 2)中找到了主要实践目标。然而,ROS 2的发布/订阅API未能强制执行DAG的优先约束:回调函数可能在执行过程中发布消息,而多输入回调允许开发者选择主题匹配策略。因此,保持DAG语义依赖于约定;一旦违反,模型即告崩溃。我们提出函数即子任务(FasS)API,将每个子任务表达为一个函数,其参数/返回值对应子任务的输入/输出边。通过最小化描述自由度,DAG语义在API层面得到保证,而非依赖程序员的自律。我们在基于Rust的实验性内核上使用FasS实现了原生DAG调度器,评估了其语义保真度,并概述了将FasS应用于Linux sched_ext的设计准则。