Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@

- [The Rust runtime](runtime.md)

- [Concurrency](concurrency.md)

- [Appendices](appendices.md)
- [Grammar summary](grammar.md)
- [Macro Follow-Set Ambiguity Formal Specification](macro-ambiguity.md)
Expand Down
10 changes: 10 additions & 0 deletions src/concurrency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
r[concurrency]
# Concurrency

r[concurrency.intro]
Rust provides language and library features for writing [concurrent programs]. These features are designed to prevent [data races] --- situations in which multiple threads access the same memory without proper synchronization, with at least one of the accesses modifying that memory.

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

[concurrent programs]: glossary.md#concurrent-program
[data races]: glossary.md#data-race
8 changes: 8 additions & 0 deletions src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Combinators are higher-order functions that apply only functions and
earlier defined combinators to provide a result from its arguments.
They can be used to manage control flow in a modular fashion.

### Concurrent program

A concurrent program is a program that can perform multiple tasks or processes at the same time, possibly overlapping in execution.

### Crate

A crate is the unit of compilation and linking. There are different [types of
Expand All @@ -60,6 +64,10 @@ may be made visible to other crates by marking them as public in the crate
root, including through [paths] of public modules.
[More][crate].

### Data race

A data race occurs when multiple threads attempt to access the same shared memory location concurrently.

### Dispatch

Dispatch is the mechanism to determine which specific version of code is actually run when it involves polymorphism. Two major forms of dispatch are static dispatch and dynamic dispatch. Rust supports dynamic dispatch through the use of [trait objects][type.trait-object].
Expand Down