Skip to content

Commit a19bc1e

Browse files
committed
Adding Send and Sync section along with the intro to this section
1 parent db28b94 commit a19bc1e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/concurrency.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,17 @@ Rust provides language and library features for writing [concurrent programs]. T
66

77
This chapter describes the traits, types, and concepts that Rust uses to express and enforce safe concurrency.
88

9+
r[concurrency.send-and-sync]
10+
## Send and Sync
11+
12+
r[concurrency.send-and-sync.intro]
13+
The [`Send`] and [`Sync`] traits are [unsafe traits] used by the Rust type system to track which types can be safely used across thread boundaries.
14+
15+
These traits are marker traits with no methods. Implementing them asserts that a type has the intrinsic properties required for safe concurrent use. The compiler automatically implements these traits for most types when possible, but they can also be implemented manually. Providing an incorrect manual implementation can cause [undefined behavior].
16+
917
[concurrent programs]: glossary.md#concurrent-program
1018
[data races]: glossary.md#data-race
19+
[`Send`]: special-types-and-traits.md#Send
20+
[`Sync`]: special-types-and-traits.md#Sync
21+
[unsafe traits]: items/traits.md#unsafe-traits
22+
[undefined behavior]: glossary.md#undefined_behavior

0 commit comments

Comments
 (0)