Skip to content

Commit a240e52

Browse files
SparrowLiitshepang
authored andcommitted
Correct some statements in parallel-rustc.md
1 parent 9c9882c commit a240e52

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/parallel-rustc.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parallelism at other stages (for example, macro expansion) also represents
88
an opportunity for improving compiler performance.
99

1010
**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`.
1212

1313
These next few sections describe where and how parallelism is currently used,
1414
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.
3131
| -------------------------------- | --------------------------------------------------- | ------------ |
3232
| Lrc | std::sync::Arc | std::rc::Rc |
3333
| 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>) |
3535
| OnceCell | std::sync::OnceLock | std::cell::OnceCell |
3636
| Lock\<T> | (parking_lot::Mutex\<T>) | (std::cell::RefCell) |
3737
| RwLock\<T> | (parking_lot::RwLock\<T>) | (std::cell::RefCell) |
3838
| MTRef<'a, T> | &'a T | &'a mut T |
3939
| MTLock\<T> | (Lock\<T>) | (T) |
4040
| ReadGuard | parking_lot::RwLockReadGuard | std::cell::Ref |
4141
| MappedReadGuard | parking_lot::MappedRwLockReadGuard | std::cell::Ref |
42-
| WriteGuard | MappedWriteGuard | std::cell::RefMut |
42+
| WriteGuard | parking_lot::MappedWriteGuard | std::cell::RefMut |
4343
| MappedWriteGuard | parking_lot::MappedRwLockWriteGuard | std::cell::RefMut |
4444
| LockGuard | parking_lot::MutexGuard | std::cell::RefMut |
4545
| MappedLockGuard | parking_lot::MappedMutexGuard | std::cell::RefMut |
@@ -58,15 +58,15 @@ was constructed on. It will panic otherwise.
5858

5959
`WorkLocal` is used to implement the `Arena` allocator in the parallel
6060
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`
6363
can be accessed directly through `Deref::deref`.
6464

6565
## Parallel Iterator
6666

6767
The parallel iterators provided by the [`rayon`] crate are efficient
6868
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
7070
execution of DAGs of tasks, not just trees.
7171

7272
Some iterator functions are implemented in the current nightly compiler to
@@ -101,10 +101,9 @@ are as follows:
101101
| rustc_interface::passes::analysis | Deathness checking | Map::par_for_each_module |
102102
| rustc_interface::passes::analysis | Privacy checking | Map::par_for_each_module |
103103
| 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 |
105105

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.
108107

109108
## Query System
110109

@@ -129,7 +128,7 @@ When a query `foo` is evaluated, the cache table for `foo` is locked.
129128
case `rustc_query_system::query::job::deadlock()` will be called to detect
130129
and remove the deadlock and then return cycle error as the query result.
131130

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
133132
the previous `Data Structures` and `Parallel Iterators`. See [this tracking issue][tracking].
134133

135134
## Rustdoc

0 commit comments

Comments
 (0)