Skip to content

Make rustc thread safe when queries can be used #46596

Closed
@Zoxc

Description

@Zoxc

This is just an issue noting down the things required to make rustc thread safe when queries can be used.

  • Make GlobalCtxt implement Sync
  • Use scoped thread locals instead of globals, WIP: Less globals #46193
  • Misc fixes required to use a rayon thread pool, WIP: Parallelize passes using rayon #46564
  • Ensure metadata loaded by LlvmMetadataLoader does not get freed on the wrong thread
  • CurrentDepGraph.task_stack has to be made a QueryJob field.
  • ParseSess.included_mod_stack might be problematic
  • Check that optimization fuel is not used with parallel queries
  • Ensure that the err_count() API is not used to discover if errors happen in parallel code
  • Find a way to order error messages deterministically so that if a query depends on another query, its error messages appear after the other query
  • Make mk_attr_id use a scoped thread local or make it part of ParseSess
  • See if we can get rid of locks on TransitiveRelation once old borrowck is gone
  • Review libproc_macro for issues, Find out which types should be Send, Sync. Deal with Deref impls for Symbol.
  • Run CI with cfg(parallel_queries)
  • Refactor away CStore::next_crate_num
  • Refactor away FileMap.external_src, FileMap.lines, FileMap.multibyte_chars, and FileMap.non_narrow_chars
  • When executing queries, instead of keeping around a lock to the query map, create a job object immediately instead

Metadata

Metadata

Assignees

Labels

C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions