Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Nov 10, 2023

During warmup, remove the volatile read to determine warm count, and instead move directly to warm and use the result of the interlocked increment. This eliminates any possible race in the transition between cold and warm.

The sequence of items in the underlying queues during cache warmup now changes: the first item added to the cache will be pushed to the cold queue. Previously it would stay in warm. Hence, some tests that depend on item order require updating.

@bitfaster bitfaster changed the title stable count during LRU warmup Stable count during LRU warmup Nov 10, 2023
@bitfaster bitfaster changed the title Stable count during LRU warmup Eliminate races during LRU warmup Nov 10, 2023
@coveralls
Copy link

Coverage Status

coverage: 98.554%. first build
when pulling fd53062 on users/alexpeck/stablewarm
into 8ac5f56 on main.

@bitfaster bitfaster marked this pull request as ready for review November 10, 2023 23:43
@bitfaster bitfaster merged commit b027a68 into main Nov 11, 2023
@bitfaster bitfaster deleted the users/alexpeck/stablewarm branch November 11, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants