Skip to content

Commit

Permalink
Refactor algorithm for next Lanes to work on (#19302)
Browse files Browse the repository at this point in the history
Some clean up to make the Lanes type easier to maintain.

I removed the "start" and "end" range markers; they don't provide any
information that isn't already encoded in the bitmask for each range,
and there's no computation saved compared to the
`pickArbitraryLane` function.

The overall algorithm is largely the same but I did tweak some of the
details. For example, if the lanes for a given priority are already
being worked on, the previous algorithm would assign to the next
available lane, including the dedicated hydration lanes that exist
in between each priority.

The updated algorithm skips over the hydration lanes and goes to the
next priority level. In the rare instance when all the non-Idle update
lanes are occupied, it will pick an abitrary default lane. This will
have the effect of invalidating the current work-in-progress, and
indicates a starvation scenario.

Eventually, if there are too many interruptions, the expiration time
mechanism will kick in and force the update to synchronously finish.
  • Loading branch information
acdlite authored Jul 9, 2020
1 parent 08b8e6e commit 14084be
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 154 deletions.
Loading

0 comments on commit 14084be

Please sign in to comment.