L3 Flashcards
Software design: Regular vs. real-time software - Static/dynamic structure
Regular: Object and data structures created/destroyed dynamicaly
Real-time: Static structures created at system initialization
Software design: Regular vs. real-time software - Control flow
Regular: Complex, implicit and data-dependent control flow
Real-time: Simple, explicit and deterministic control flow
Software design: Regular vs. real-time software - Concurrency
Regular: Fair interleaved execution - optimized for average case
Real-time: Predictable (priority-based) scheduler - predictable worst case
When can multiple tasks use the same sensor?
- If reading from a sensor is fast and simple, tasks can share it
- If reading form the sensor is complicated or takes a long time, a dedicated task might be more appropriate
Separating common computations?
- If activities need the same computed data, computing it in a separate task can be more efficient and easier to maintain
Identifying tasks - Decomposing functions into tasks
- avoid overhead (at runtime and in analysis) of too many tasks
- consider separation of functions, especially those with different timing constraints
- consider the joint use of sensors, actuators or intermediate results
A single task is not always a good solution.
- Handling many functions in a single task, at the frequency required by the strictest timing requirements, is often not possible
- Even if it is possible, we often waste resources with this solution.
When can multiple tasks control the same actuator?
- As for sensors, is writing to the actuator fast and simple?
- Additionally, will the different functions interfere with each other?
Assigning task periods
Periodicity constraints
- use a task period shorter or equal to the periodicity value
Latest response time constraints
- Note: Period t does not satisfy “react within t times units”
- however, any period shorter or equal to t/2 does!
Separation, periodicity with output jitter, earliest response time
- these cant be satisfied in a good way by just period assignment
All tasks involved in a function must be considered
- giving just one task a short period does not improve the overall timing