mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
doc: add a paragraph to software_tasks.md
This commit is contained in:
parent
f6eacdc8d1
commit
c43788f141
1 changed files with 4 additions and 0 deletions
|
|
@ -84,6 +84,10 @@ $ cargo xtask qemu --verbose --example spawn_arguments
|
|||
{{#include ../../../../ci/expected/lm3s6965/spawn_arguments.run}}
|
||||
```
|
||||
|
||||
## Divergent tasks
|
||||
|
||||
A task can have one of two signatures: `async fn({name}::Context, ..)` or `async fn({name}::Context, ..) -> !`. The latter defines a *divergent* task — one that never returns. The key advantage of divergent tasks is that they receive a `'static` context, and `local` resources have `'static` lifetime. Additionally, using this signature makes the task’s intent explicit, clearly distinguishing between short-lived tasks and those that run indefinitely.
|
||||
|
||||
## Priority zero tasks
|
||||
|
||||
In RTIC tasks run preemptively to each other, with priority zero (0) the lowest priority. You can use priority zero tasks for background work, without any strict real-time requirements.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue