diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2020-10-08 17:33:42 +0200 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2020-10-08 17:33:42 +0200 |
| commit | c83b15b643346c54f09ef130b5abd5ca31abfcd5 (patch) | |
| tree | b1b350b834c243e05f4328d1b4922f1d9e0f373c /book/en/src/by-example/resources.md | |
| parent | e8b4fa7b32cf044428971f22e01428ff9cccff3c (diff) | |
| parent | 36781cdd890752d6876623d8802b860e950b24eb (diff) | |
Merge branch 'master' into spawn_experiment
Diffstat (limited to 'book/en/src/by-example/resources.md')
| -rw-r--r-- | book/en/src/by-example/resources.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md index d082dfc..9d90fbe 100644 --- a/book/en/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -1,4 +1,4 @@ -## Resources +# Resources The framework provides an abstraction to share data between any of the contexts we saw in the previous section (task handlers, `init` and `idle`): resources. @@ -116,7 +116,9 @@ are required to access the resource even if the resource is contended by several tasks running at different priorities. The downside is that the task only gets a shared reference (`&-`) to the resource, limiting the operations it can perform on it, but where a shared reference is enough this approach reduces the number -of required locks. +of required locks. In addition to simple immutable data, this shared access can +be useful where the resource type safely implements interior mutability, with +appropriate locking or atomic operations of its own. Note that in this release of RTIC it is not possible to request both exclusive access (`&mut-`) and shared access (`&-`) to the *same* resource from different |
