[ https://issues.apache.org/jira/browse/GEODE-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15886980#comment-15886980 ]
ASF GitHub Bot commented on GEODE-2531: --------------------------------------- Github user pivotal-jbarrett commented on a diff in the pull request: https://github.com/apache/geode-native/pull/37#discussion_r103354398 --- Diff: src/cppcache/include/geode/CacheStatistics.hpp --- @@ -102,8 +102,8 @@ class CPPCACHE_EXPORT CacheStatistics : public SharedBase { virtual void setLastAccessedTime(uint32_t lat); virtual void setLastModifiedTime(uint32_t lmt); - volatile uint32_t m_lastAccessTime; - volatile uint32_t m_lastModifiedTime; + std::atomic<uint32_t> m_lastAccessTime; + std::atomic<uint32_t> m_lastModifiedTime; --- End diff -- The original code was using atomic operations already, just from multiple platform specific sources. std::atomic gets compiled into whatever is most performant for the platform. I would guess that this is actually faster than whatever we were doing on each platform since many were function calls into another library. This code will get compiled to atomic put opcodes on most platforms (with appropriate memory synchronization between caches). > Replace HostAsm::atomic* and AtomicInc with std::atomic > ------------------------------------------------------- > > Key: GEODE-2531 > URL: https://issues.apache.org/jira/browse/GEODE-2531 > Project: Geode > Issue Type: Sub-task > Components: native client > Reporter: Jacob S. Barrett > Assignee: Jacob S. Barrett > > Replace {{HostAsm::atomic*}} and {{AtomicInc}} with > {{[std::atomic|http://en.cppreference.com/w/cpp/atomic/atomic]}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)