From d0bf0d7a4441e5fd1d26d9794e6a2c6e1b82cd0c Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Fri, 5 May 2023 03:50:17 -0400 Subject: [PATCH] Order Send/Sync before Arc/Mutex (#605) The Arc/Mutex chapters mention Send/Sync in the speaker notes, and in fact serve as good illustrations of the traits, so let's define the traits before referencing them. --- src/SUMMARY.md | 8 ++++---- src/concurrency/send-sync/send.md | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 086b717d..2d2877c8 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -261,14 +261,14 @@ - [Channels](concurrency/channels.md) - [Unbounded Channels](concurrency/channels/unbounded.md) - [Bounded Channels](concurrency/channels/bounded.md) -- [Shared State](concurrency/shared_state.md) - - [Arc](concurrency/shared_state/arc.md) - - [Mutex](concurrency/shared_state/mutex.md) - - [Example](concurrency/shared_state/example.md) - [Send and Sync](concurrency/send-sync.md) - [Send](concurrency/send-sync/send.md) - [Sync](concurrency/send-sync/sync.md) - [Examples](concurrency/send-sync/examples.md) +- [Shared State](concurrency/shared_state.md) + - [Arc](concurrency/shared_state/arc.md) + - [Mutex](concurrency/shared_state/mutex.md) + - [Example](concurrency/shared_state/example.md) - [Exercises](exercises/concurrency/morning.md) - [Dining Philosophers](exercises/concurrency/dining-philosophers.md) - [Multi-threaded Link Checker](exercises/concurrency/link-checker.md) diff --git a/src/concurrency/send-sync/send.md b/src/concurrency/send-sync/send.md index 8aa1be26..934ab3c5 100644 --- a/src/concurrency/send-sync/send.md +++ b/src/concurrency/send-sync/send.md @@ -7,3 +7,10 @@ in that thread. So the question is when you can allocate a value in one thread and deallocate it in another. [1]: https://doc.rust-lang.org/std/marker/trait.Send.html + +
+ +As an example, a connection to the SQLite library must only be accessed from a +single thread. + +