220 15345 <71d4ea44-aec9-4bfa-a1a8-ba81ca745b84@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Ramkumar Revanur <write2ramkumar@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: get count of std::weak_ptr objects tracking a
 shared resource
Date: Sat, 27 Dec 2014 21:07:47 -0800 (PST)
Lines: 74
Approved: news@gmane.org
Message-ID: <71d4ea44-aec9-4bfa-a1a8-ba81ca745b84@isocpp.org>
References: <a9c1d3d5-761d-44df-b722-ae649440ea77@isocpp.org>	<4797942.dAdOve4yz0@tjmaciei-mobl4> <CAFk2RUYxhUoBHap95bQVwZbFrjJq6i37FAEec2LG6gYguenJkQ@mail.gmail.com>
 <549C50C1.8060008@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_5260_1886655065.1419743267485"
X-Trace: ger.gmane.org 1419743277 26915 80.91.229.3 (28 Dec 2014 05:07:57 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 28 Dec 2014 05:07:57 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCD4HFPP7UBRBJFA72SAKGQE4CSC7GA@isocpp.org Sun Dec 28 06:07:50 2014
Return-path: <std-proposals+bncBCD4HFPP7UBRBJFA72SAKGQE4CSC7GA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f69.google.com ([209.85.216.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCD4HFPP7UBRBJFA72SAKGQE4CSC7GA@isocpp.org>)
	id 1Y564z-0004JE-Q4
	for gclcip-std-proposals@m.gmane.org; Sun, 28 Dec 2014 06:07:49 +0100
Original-Received: by mail-qa0-f69.google.com with SMTP id f12sf20136495qad.4
        for <gclcip-std-proposals@m.gmane.org>; Sat, 27 Dec 2014 21:07:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=d8tve5Vjik49MsBND9KjlUcumVsEsVPpqq0ie0N3nzk=;
        b=SQGRFEL5PRyQ6kKf+VvyUtvUy96KUMY3J4ZYGcwESEsw6Zq3SdKky4sMRIea2wJOkW
         4HKpu6PP0K4vyc3u0IK4wDCniUm88+kiMedvLQpaPL5q/2j3EB8GOW6GruoTgr8XFnRw
         6tdWyLJU5+Qy6QzJ4jruWL7AmQyzJlIKdSKCkdDWucyG9D1IlEQmT+dw8G2VjSBYGNt2
         cZsML2LylphdryJtn1y9Q67rMD5c71kGdHF8YTGz250uXdL2z8IxfW/zRGKg79aMldur
         PO1CUrtRQ4xeN6dE9rFbsto+CG/BJ/AFpte8r5opnJYJyqAVzeAhWz22tU/zFPQoCZIe
         drfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=d8tve5Vjik49MsBND9KjlUcumVsEsVPpqq0ie0N3nzk=;
        b=hsNmmjbOR+qlueIBSNw5tRT5B/6qveIVMcjy91XCnTvBQsKKfYRQBmCu6OVXs79nVj
         zCuQNMC+lq7thpR/m9wZEBPQA9i7+MbMW5ehIT+2lFTVoyVyJI119pj2vxnnlBbcHi5V
         2MbCWoiO9YQBcfcrf39ZgDNAYlwaDpEh9oefrDwx3kJl7MkCGRqzwneWZqrk+nuKs4uO
         EKlWLT5+4K9o/oYsQIz+2WTsaz2gyE9pM+AXShGaQCzO/nY/MrzF1C+wDnn/L0yNuQ6+
         +ubOu2BMjNxjSw4iLvgxcjjhTOMnh8knwPG5QmgUck3nsuPodR39tjb6Z0K+RvPjhl3N
         x5fg==
X-Gm-Message-State: ALoCoQlBG6rmkHD9jG+BV5ekO7c+e2u/vc/hfdGNNeA8PDJtJWGM0Vq1WP4WXwFG0aiAt6TCaUFl
X-Received: by 10.236.203.98 with SMTP id e62mr124479yho.56.1419743268999;
        Sat, 27 Dec 2014 21:07:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.36.10 with SMTP id m10ls2014438igj.12.gmail; Sat, 27 Dec
 2014 21:07:48 -0800 (PST)
X-Received: by 10.50.43.199 with SMTP id y7mr607399igl.5.1419743268288;
        Sat, 27 Dec 2014 21:07:48 -0800 (PST)
In-Reply-To: <549C50C1.8060008@gmail.com>
X-Original-Sender: write2ramkumar@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:15345
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15345>

------=_Part_5260_1886655065.1419743267485
Content-Type: multipart/alternative; 
	boundary="----=_Part_5261_1415629500.1419743267485"

------=_Part_5261_1415629500.1419743267485
Content-Type: text/plain; charset=UTF-8

Just as new shared_ptr can be created to the same resource from existing 
shared_ptr. The reliability of the "weak_count" is same as the reliability 
of use_count on a shared_ptr.



On Thursday, December 25, 2014 11:29:48 PM UTC+5:30, Miro Knejp wrote:
>
> On 25 December 2014 at 17:43, Thiago Macieira <thi...@macieira.org 
> <javascript:>> wrote: 
> > The only thread-safe information is whether a given weak_ptr is the last 
> > reference (i.e., count == 1). 
> And not even that is reliable as new independent weak_ptr instances can 
> be created as long as a shared_ptr exists. 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_5261_1415629500.1419743267485
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Just as new shared_ptr can be created to the same resource=
 from existing shared_ptr. The reliability of the "weak_count" is same as t=
he reliability of use_count on a shared_ptr.<div><br></div><div><br><br>On =
Thursday, December 25, 2014 11:29:48 PM UTC+5:30, Miro Knejp wrote:<blockqu=
ote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left=
: 1px #ccc solid;padding-left: 1ex;">On 25 December 2014 at 17:43, Thiago M=
acieira &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"9OdhpExsiRcJ" onmousedown=3D"this.href=3D'javascript:';return true;" on=
click=3D"this.href=3D'javascript:';return true;">thi...@macieira.org</a>&gt=
; wrote:
<br>&gt; The only thread-safe information is whether a given weak_ptr is th=
e last
<br>&gt; reference (i.e., count =3D=3D 1).
<br>And not even that is reliable as new independent weak_ptr instances can=
=20
<br>be created as long as a shared_ptr exists.
<br>
<br></blockquote></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5261_1415629500.1419743267485--
------=_Part_5260_1886655065.1419743267485--

.
