aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrafael <rafael>2024-07-08 23:27:42 +0200
committerrafael <rafael>2024-07-08 23:27:42 +0200
commit2f62376a15b931dcf24708717695107f2c99fb1b (patch)
treef25a6561a7987a308ab2aa1331bf86befade4661
parent52c43f024939956d3b8d45cada70aaaa35dfbebd (diff)
add faq
-rw-r--r--docs/pages/faq.adoc4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc
index fc1316062..4ab04e2a1 100644
--- a/docs/pages/faq.adoc
+++ b/docs/pages/faq.adoc
@@ -358,3 +358,7 @@ An example showcasing some methods for sharing things between tasks link:https:/
358But when it comes to "waking" tasks, for example when a data transfer is complete or a button is pressed, it's faster to wake a dedicated task, because that task does not need to check which future is actually ready. `join` and `select` must check ALL of the futures they are managing to see which one (or which ones) are ready to do more work. This is because all Rust executors (like Embassy or Tokio) only have the ability to wake tasks, not specific futures. This means you will use slightly less CPU time juggling futures when using dedicated tasks. 358But when it comes to "waking" tasks, for example when a data transfer is complete or a button is pressed, it's faster to wake a dedicated task, because that task does not need to check which future is actually ready. `join` and `select` must check ALL of the futures they are managing to see which one (or which ones) are ready to do more work. This is because all Rust executors (like Embassy or Tokio) only have the ability to wake tasks, not specific futures. This means you will use slightly less CPU time juggling futures when using dedicated tasks.
359 359
360Practically, there's not a LOT of difference either way - so go with what makes it easier for you and your code first, but there will be some details that are slightly different in each case. 360Practically, there's not a LOT of difference either way - so go with what makes it easier for you and your code first, but there will be some details that are slightly different in each case.
361
362== splitting peripherals resources between tasks
363
364There are two ways to split resources between tasks, either manually assigned or by a convenient macro. See link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/assign_resources.rs[this example] \ No newline at end of file