[
https://issues.apache.org/jira/browse/MESOS-1861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14158579#comment-14158579
]
Jie Yu commented on MESOS-1861:
-------------------------------
In general, we do not encourage people to directly use std::shared_ptr in the
code base (especially in Mesos code). The reason is because of the concurrency
issue. If two threads both have the shared_ptr to the same shared data
structure, and one of them tries to write the shared data structure, it could
cause race condition. And in our actor based async programming environment, we
usually disallow the use of mutex/locks as it could block worker threads!
Therefore, we introduced Shared and it's read-only. In that way, race condition
is not possible.
> deprecate process::Shared
> -------------------------
>
> Key: MESOS-1861
> URL: https://issues.apache.org/jira/browse/MESOS-1861
> Project: Mesos
> Issue Type: Improvement
> Components: libprocess
> Reporter: Dominic Hamon
> Priority: Minor
> Labels: c++11, newbie
>
> Deprecate {{process::Shared}} in favour of {{std::shared_ptr}} or
> {{std::tr1::shared_ptr}} from stout/memory.hpp.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)