mirror of
https://github.com/mickael-menu/zk
synced 2024-11-19 03:25:40 +00:00
11 lines
482 B
Markdown
11 lines
482 B
Markdown
# Mutex
|
|
|
|
* Abbreviation of *mutual exclusion*.
|
|
* An approach to manage safely shared state by allowing only a single thread to access a protected value at one time.
|
|
* A mutex *guards* a protected data with a *locking system*.
|
|
* Managing mutexes is tricky, using [channels](../fwsj) is an easier alternative.
|
|
* The main risk is to create *deadlocks*.
|
|
* Thanks to its [Ownership](../88el) pattern, Rust makes sure we can't mess up when using locks.
|
|
|
|
:programming:
|