Skip to content

Simplify lazy initialization by removing Volatile.Read #117868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Jul 21, 2025

Replaced Volatile.Read with plain field reads. The memory barriers provided by CompareExchange are sufficient to ensure thread safety and visibility, making Volatile.Read unnecessary.

Follow-up to #117817

Related: #100969

cc: @stephentoub

Replaced `Volatile.Read` with plain field reads. The memory barriers provided by `CompareExchange` are
sufficient to ensure thread safety and visibility, making `Volatile.Read`
unnecessary.

Follow-up to dotnet#117817

Related: dotnet#100969

cc: @stephentoub
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 21, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 21, 2025
@stephentoub
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants