* Typo

* Update src/queries/query-evaluation-model-in-detail.md

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
This commit is contained in:
Alex Aktsipetrov 2020-03-27 11:42:53 +01:00 committed by GitHub
parent ce5a554075
commit 7f3f063b5c
1 changed files with 3 additions and 3 deletions

View File

@ -159,7 +159,8 @@ would still exist and already executed queries would not have to be re-done.
## Cycles ## Cycles
Earlier we stated that query invocations form a DAG. However, it would be easy Earlier we stated that query invocations form a DAG. However, it would be easy
form a cyclic graph by, for example, having a query provider like the following: to form a cyclic graph by, for example, having a query provider like the
following:
```rust,ignore ```rust,ignore
fn cyclic_query_provider(tcx, key) -> u32 { fn cyclic_query_provider(tcx, key) -> u32 {
@ -225,7 +226,7 @@ The nightly compiler already implements parallel query evaluation as follows:
When a query `foo` is evaluated, the cache table for `foo` is locked. When a query `foo` is evaluated, the cache table for `foo` is locked.
- If there already is a result, we can clone it,release the lock and - If there already is a result, we can clone it, release the lock and
we are done. we are done.
- If there is no cache entry and no other active query invocation computing the - If there is no cache entry and no other active query invocation computing the
same result, we mark the key as being "in progress", release the lock and same result, we mark the key as being "in progress", release the lock and
@ -235,4 +236,3 @@ When a query `foo` is evaluated, the cache table for `foo` is locked.
computed the result we are waiting for. This cannot deadlock because, as computed the result we are waiting for. This cannot deadlock because, as
mentioned before, query invocations form a DAG. Some thread will always make mentioned before, query invocations form a DAG. Some thread will always make
progress. progress.