Skip to content

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

Description

@pengwang7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions