Skip to content

Commit ce37fa2

Browse files
committed
Adding data race definition to the glossary and referencing it in the concurrency chapter
1 parent f200b19 commit ce37fa2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/concurrency.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ r[concurrency]
22
# Concurrency
33

44
r[concurrency.intro]
5-
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.
5+
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.
66

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

99
[concurrent programs]: glossary.md#concurrent-program
10+
[data races]: glossary.md#data-race

src/glossary.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ may be made visible to other crates by marking them as public in the crate
6464
root, including through [paths] of public modules.
6565
[More][crate].
6666

67+
### Data race
68+
69+
A data race occurs when multiple threads attempt to access the same shared memory location concurrently.
70+
6771
### Dispatch
6872

6973
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].

0 commit comments

Comments
 (0)