mirror of https://github.com/mickael-menu/zk
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
443 B
Markdown
14 lines
443 B
Markdown
3 years ago
|
# Data race error
|
||
|
|
||
|
A *data race* is similar to a race condition and happens when:
|
||
|
|
||
|
* Two or more pointers access the same data at the same time.
|
||
|
* At least one of the pointers is being used to write to the data.
|
||
|
* There's no synchronization mechanism to protect the data.
|
||
|
|
||
|
*Data races* cause undefined behavior and are hard to debug.
|
||
|
|
||
|
Rust prevents *data races* by allowing only a single mutable reference of a value per scope.
|
||
|
|
||
|
:programming:
|