rorygraves / scalac_perf

The Scala programming language
http://www.scala-lang.org/
16 stars 3 forks source link

pkukielka/2.13.x patmat improved #65

Closed pkukielka closed 6 years ago

mkeskells commented 6 years ago

Looking through the data changes there are a few types - if we consider a conceptual model where there is a main compiler thread that distributes work and collects it, and worker threads. A worker thread, or a work task will have local data that is private

This is after looking through the change that you have, and overlaps and contradicts the comments that I have made. This is more to open the conversation as to whatthe data access pattern is, and we should comment of that assumption as we make each change

  1. something that is configured in the main thread only - may be a normal private var, but updates (and maybe reads) are validated with asserts to be on the main thread
  2. Something that is local data on a worker thread - assert all access is on the worker thread and the task is the current task
  3. Counters, ids and stats - AtomicIntegers etc - need to check for TOCTOU though for ids
  4. Shared data written once only - need to validate that there are no races ( e.g. Symbol.info )
  5. concurrent data - not sure I have seen any of that really
mkeskells commented 6 years ago

I thing that reads should have the same signatures as the vars they replace - less code change (e.g. all of the severity code)