Meng Zhu created MESOS-9250:
-------------------------------
Summary: Introduce a copy-on-write type to enforce safe mutation
with exclusive ownership.
Key: MESOS-9250
URL: https://issues.apache.org/jira/browse/MESOS-9250
Project: Mesos
Issue Type: Improvement
Reporter: Meng Zhu
Assignee: Meng Zhu
Resource copy-on-write optimization has been landed (MESOS-6765). But the
no-mutation-without-exclusive-ownership rule is not enforced. This is
error-prone as ownership needs to be manually checked every time:
{code:c++}
if (resource_.use_count() > 1) {
resource_ = make_shared<Resource_>(*resource_);
}
{code}
It will be great to introduce a templated COW wrapper class that enforces such
semantic, such construct could also be reused in other places.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)