Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upQuery Parallelization Tracking Issue #48685
Comments
This comment has been minimized.
This comment has been minimized.
nikomatsakis
referenced this issue
Mar 2, 2018
Merged
Make TransitiveRelation thread safe. Avoid locking by using get_mut in some cases #48587
michaelwoerister
referenced this issue
Apr 6, 2018
Closed
Make rustc thread safe when queries can be used #46596
This was referenced Apr 9, 2018
This comment has been minimized.
This comment has been minimized.
|
I'm trying to identify the blocking issues for a minimal but correct version of parallel queries. Ideally we would solve all of them over the next few weeks So far I've found:
There are a few things that also need to be solved medium term, but they are not blocking yet:
@Zoxc, @nikomatsakis, @oli-obk, @eddyb: I'm sure this list does not cover all blockers. Let me know what I forgot |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister We also have to make queries work on a Rayon thread-pool |
This comment has been minimized.
This comment has been minimized.
What exactly does this involve? |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister We have to make waiting on already executing queries block and also detect and recover from query cycles |
This comment has been minimized.
This comment has been minimized.
|
Ah, right. The blocking should be easy enough. I have not thought in detail about cycle detection and recovery though. |
Zoxc
added
the
A-parallel-queries
label
May 7, 2018
jkordish
added
the
C-enhancement
label
May 16, 2018
This comment has been minimized.
This comment has been minimized.
Both of these should be implemented by #50699, right? |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister Yeah. |
xftroxgpx
referenced this issue
Jan 2, 2019
Closed
error[E0277]: `syntax_pos::symbol::LocalInternedString` cannot be sent between threads safely #3613
This comment has been minimized.
This comment has been minimized.
xftroxgpx
commented
Jan 3, 2019
•
|
A rustc HEAD compiled with |
nikomatsakis commentedMar 2, 2018
•
edited by alexcrichton
This issue is a sub-issue of #48547: it tracks the in-progress effort to parallelize rustc across queries. This work is being spearheaded by @Zoxc.
Goals
Allow rustc to execute queries in parallel with one another. Enable the use of rayon or other tools for intra-query parallelization as well. See this internals thread for more information.
Overview of the plan
RefCellusage withMutexPending refactorings
TransitiveRelationdoesn't really need to use aRefCell. In the future, it won't even be shared, but regardless the caching scheme could be reworked to avoidRefCell.QueryJobfield. (implemented in #49732)mk_attr_iduse a scoped thread local or make it part ofParseSesslibproc_macrofor issues, Find out which types should beSend,Sync. Deal withDerefimpls forSymbol. (#49219)CStore::next_crate_numFileMap.lines,FileMap.multibyte_chars, andFileMap.non_narrow_charsimmutable (implemented in #50997)GlobalCtxt::layout_depthso it does not need global mutable state (#49735)GlobalCtxt.rcache,OnDiskCache.file_index_to_fileandOnDiskCache.synthetic_expansion_infosare faster as thread-localsDepGraph.try_mark_greenSession.lint_storeandSession.buffered_lintsDepGraphData.previous_work_productsso it becomes immutable (#50501) (implemented in #50524)DepGraphData.work_productsby threaded the value throughsave_trans_partition() -> copy_module_artifacts_into_incr_comp_cache() -> OngoingCrateTranslation::join()(#50500) (implemented in #50558)