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

关于volatile变量相关的问题 #242

Open
pengwang7 opened this issue Jul 26, 2021 · 0 comments
Open

关于volatile变量相关的问题 #242

pengwang7 opened this issue Jul 26, 2021 · 0 comments

Comments

@pengwang7
Copy link

pengwang7 commented Jul 26, 2021

看了代码中有很多volatile修饰的变量,目的是什么,为了statistics更加准确以及为了使用sofa-pbrpc中提供的原子操作吗?
代码中有这样的注释:
// And here we need not lock "_pending_lock" because the "_pending_message_count" is
// an volatile value.
请教一下volatile与锁有关系吗?

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

No branches or pull requests

1 participant