I have a use case where I would like one task to have priority over another task:
In EtherCAT (an industrial ethernet protocol), there is a concept of cyclic data exchange and acyclic data exchange. One can accomplish this with two tasks:
- cyclic task, high priority. this task should send an ethernet frame every 2000 us +/- 200 us (for example). For reference, a single ethernet frame (1522 bytes), can take 124 us to transmit at 100 Mbps.
- acyclic task, low priority, this task has almost no timing requirements and just needs to send ethernet frames whenever it can fit in to the time left over from the cyclic task
typically I would accomplish this by setting thread priorities at the OS level (like using SCHED_FIFO on PREEMPT_RT linux).
But I am wondering if there is a place for task prioritization (as parameters to groupConcurrent)? Perhaps it only makes sense to define task prioritization in relation to other tasks (hence it only being applied to groupConcurrent)?. But you would likely want a subtask to inherit the priority of its parent task, and the same would be true for mutexes…so maybe you would need to support prioritization across the entire interface…