Skip to content

Commit 68c066a

Browse files
authored
Merge pull request #80 from wezm/book-tweaks
Fix a couple of typos in the book
2 parents e9e3754 + ed81a9e commit 68c066a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/src/concepts/futures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Luckily, concurrent Rust already has two well-known and effective concepts abstr
1010

1111
As a quick summary:
1212

13-
- `Send` abstracts over *passing data* in a computation to another concurrent computation (let's call it the receiver), losing access to it on the sender side. In many programming languages, this strategy is commonly implemented, but missing support from the language side expects you to enforce the "losing access" behaviour yourself. This is a regular source of bugs: senders keeping handles to sent things around and maybe even working with them after sending. Rust mitigates this problem by making this behaviour known. Types can be `Send` or not (by implementing the appropriate marker trait), allowing or disallowing sending them around, and the ownership and borrowing rules prevent subsequent access.
13+
- `Send` abstracts over *passing data* in a computation to another concurrent computation (let's call it the receiver), losing access to it on the sender side. In many programming languages, this strategy is commonly implemented, but missing support from the language side, and expects you to enforce the "losing access" behaviour yourself. This is a regular source of bugs: senders keeping handles to sent things around and maybe even working with them after sending. Rust mitigates this problem by making this behaviour known. Types can be `Send` or not (by implementing the appropriate marker trait), allowing or disallowing sending them around, and the ownership and borrowing rules prevent subsequent access.
1414

1515
- `Sync` is about *sharing data* between two concurrent parts of a program. This is another common pattern: as writing to a memory location or reading while another party is writing is inherently unsafe, this access needs to be moderated through synchronisation.[^1] There are many common ways for two parties to agree on not using the same part in memory at the same time, for example mutexes and spinlocks. Again, Rust gives you the option of (safely!) not caring. Rust gives you the ability to express that something *needs* synchronisation while not being specific about the *how*.
1616

docs/src/concepts/tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Tasks in `async_std` are one of the core abstractions. Much like Rust's `thread`
6363

6464
- They are allocated in one single allocation
6565
- All tasks have a *backchannel*, which allows them to propagate results and errors to the spawning task through the `JoinHandle`
66-
- The carry useful metadata for debugging
66+
- They carry useful metadata for debugging
6767
- They support task local storage
6868

69-
`async_std`s task api handles setup and teardown of a backing runtime for you and doesn't rely on a runtime being explicitly started.
69+
`async_std`s task API handles setup and teardown of a backing runtime for you and doesn't rely on a runtime being explicitly started.
7070

7171
## Blocking
7272

0 commit comments

Comments
 (0)