aboutsummaryrefslogtreecommitdiff
path: root/book/en/src
diff options
context:
space:
mode:
authorOleksandr Babak <alexanderbabak@proton.me>2025-03-23 11:42:22 +0100
committerEmil Fresk <emil.fresk@gmail.com>2025-03-27 14:47:11 +0000
commitc43788f141650805aa53aa882f9b5290b1dcdceb (patch)
treee6a8b13b246210666dda97ab9ad2c6f89861a5de /book/en/src
parentf6eacdc8d16fd0b47d28fa6a84e6099c9c09eca9 (diff)
doc: add a paragraph to `software_tasks.md`
Diffstat (limited to 'book/en/src')
-rw-r--r--book/en/src/by-example/software_tasks.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/book/en/src/by-example/software_tasks.md b/book/en/src/by-example/software_tasks.md
index 5d5ef71..f18e746 100644
--- a/book/en/src/by-example/software_tasks.md
+++ b/book/en/src/by-example/software_tasks.md
@@ -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.