]> git.proxmox.com Git - rustc.git/blob - src/doc/nomicon/concurrency.md
Imported Upstream version 1.3.0+dfsg1
[rustc.git] / src / doc / nomicon / concurrency.md
1 % Concurrency and Paralellism
2
3 Rust as a language doesn't *really* have an opinion on how to do concurrency or
4 parallelism. The standard library exposes OS threads and blocking sys-calls
5 because everyone has those, and they're uniform enough that you can provide
6 an abstraction over them in a relatively uncontroversial way. Message passing,
7 green threads, and async APIs are all diverse enough that any abstraction over
8 them tends to involve trade-offs that we weren't willing to commit to for 1.0.
9
10 However the way Rust models concurrency makes it relatively easy design your own
11 concurrency paradigm as a library and have everyone else's code Just Work
12 with yours. Just require the right lifetimes and Send and Sync where appropriate
13 and you're off to the races. Or rather, off to the... not... having... races.