Skip to content
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

Apply volatile modifier to flowRules variable while keep concurrency … #2107

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

JerryChin
Copy link
Contributor

…semantics intact (#2103)

Describe what this PR does / why we need it

Refactor FlowRuleManager as suggested in issue #2103

Does this pull request fix one issue?

Fixes #2103

Describe how you did it

Use volatile keyword instead of AtomicReference for flowRules variable, the former is a lighter way to keep memory consistency.

Describe how to verify it

Read the source code of AtomicReference, It internally also uses volatile keyword,, so nothing is really changed.

Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Apr 1, 2021

CLA assistant check
All committers have signed the CLA.

@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Apr 1, 2021
Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sczyh30 sczyh30 merged commit 4e8a12b into alibaba:master Apr 27, 2021
@sczyh30
Copy link
Member

sczyh30 commented Apr 27, 2021

Thanks for contributing!

sczyh30 pushed a commit that referenced this pull request Apr 27, 2021
hughpearse pushed a commit to hughpearse/Sentinel that referenced this pull request Jun 2, 2021
linkolen pushed a commit to shivagowda/Sentinel that referenced this pull request Aug 14, 2021
linkolen pushed a commit to shivagowda/Sentinel that referenced this pull request Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlowRuleManager类中flowRules不需要用AtomicReference
4 participants