Skip to content

Commit 14084be

Browse files
authored
Refactor algorithm for next Lanes to work on (facebook#19302)
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.
1 parent 08b8e6e commit 14084be

File tree

2 files changed

+103
-154
lines changed

2 files changed

+103
-154
lines changed

0 commit comments

Comments
 (0)