@@ -8,7 +8,7 @@ parallelism at other stages (for example, macro expansion) also represents
8
8
an opportunity for improving compiler performance.
9
9
10
10
** To try out the current parallel compiler** , one can install rustc from
11
- source code with enable ` parallel-compiler = true ` in the ` config.toml ` .
11
+ source code with ` parallel-compiler = true ` in the ` config.toml ` .
12
12
13
13
These next few sections describe where and how parallelism is currently used,
14
14
and the current status of making parallel compilation the default in ` rustc ` .
@@ -31,15 +31,15 @@ are implemented diferently depending on whether `parallel-compiler` is true.
31
31
| -------------------------------- | --------------------------------------------------- | ------------ |
32
32
| Lrc | std::sync::Arc | std::rc::Rc |
33
33
| Weak | std::sync::Weak | std::rc::Weak |
34
- | Atomic{Bool}/{Usize}/{U32}/{U64} | std::sync::atomic::Atomic{Bool}/{Usize}/{U32}/{U64} | (Cell\ < Bool/Usize/U32/U64>) |
34
+ | Atomic{Bool}/{Usize}/{U32}/{U64} | std::sync::atomic::Atomic{Bool}/{Usize}/{U32}/{U64} | (std::cell:: Cell<Bool/Usize/U32/U64>) |
35
35
| OnceCell | std::sync::OnceLock | std::cell::OnceCell |
36
36
| Lock\< T> | (parking_lot::Mutex\< T>) | (std::cell::RefCell) |
37
37
| RwLock\< T> | (parking_lot::RwLock\< T>) | (std::cell::RefCell) |
38
38
| MTRef<'a, T> | &'a T | &'a mut T |
39
39
| MTLock\< T> | (Lock\< T>) | (T) |
40
40
| ReadGuard | parking_lot::RwLockReadGuard | std::cell::Ref |
41
41
| MappedReadGuard | parking_lot::MappedRwLockReadGuard | std::cell::Ref |
42
- | WriteGuard | MappedWriteGuard | std::cell::RefMut |
42
+ | WriteGuard | parking_lot:: MappedWriteGuard | std::cell::RefMut |
43
43
| MappedWriteGuard | parking_lot::MappedRwLockWriteGuard | std::cell::RefMut |
44
44
| LockGuard | parking_lot::MutexGuard | std::cell::RefMut |
45
45
| MappedLockGuard | parking_lot::MappedMutexGuard | std::cell::RefMut |
@@ -58,15 +58,15 @@ was constructed on. It will panic otherwise.
58
58
59
59
` WorkLocal ` is used to implement the ` Arena ` allocator in the parallel
60
60
environment, which is critical in parallel queries. Its implementation
61
- locals in the ` rustc-rayon-core::worker_local ` module. However, in the
62
- non-parallel compiler, it is implemented as ` (OneThread<T>) ` , which ` T `
61
+ is located in the ` rustc-rayon-core::worker_local ` module. However, in the
62
+ non-parallel compiler, it is implemented as ` (OneThread<T>) ` , whose ` T `
63
63
can be accessed directly through ` Deref::deref ` .
64
64
65
65
## Parallel Iterator
66
66
67
67
The parallel iterators provided by the [ ` rayon ` ] crate are efficient
68
68
ways to achieve parallelization. The current nightly rustc uses (a custom
69
- ork of) [ ` rayon ` ] to run tasks in parallel. The custom fork allows the
69
+ fork of) [ ` rayon ` ] to run tasks in parallel. The custom fork allows the
70
70
execution of DAGs of tasks, not just trees.
71
71
72
72
Some iterator functions are implemented in the current nightly compiler to
@@ -101,10 +101,9 @@ are as follows:
101
101
| rustc_interface::passes::analysis | Deathness checking | Map::par_for_each_module |
102
102
| rustc_interface::passes::analysis | Privacy checking | Map::par_for_each_module |
103
103
| rustc_lint::late::check_crate | Run per-module lints | Map::par_for_each_module |
104
- | rustc_typeck::check_crate | well formed checking | Map::par_for_each_module |
104
+ | rustc_typeck::check_crate | Well formed checking | Map::par_for_each_module |
105
105
106
- And There are still many loops that have the potential to use
107
- parallel iterators.
106
+ There are still many loops that have the potential to use parallel iterators.
108
107
109
108
## Query System
110
109
@@ -129,7 +128,7 @@ When a query `foo` is evaluated, the cache table for `foo` is locked.
129
128
case ` rustc_query_system::query::job::deadlock() ` will be called to detect
130
129
and remove the deadlock and then return cycle error as the query result.
131
130
132
- Parallel query still has a lot of work to do, most of which are related to
131
+ Parallel query still has a lot of work to do, most of which is related to
133
132
the previous ` Data Structures ` and ` Parallel Iterators ` . See [ this tracking issue] [ tracking ] .
134
133
135
134
## Rustdoc
0 commit comments