220 33602 <c019348f-8a1f-46b3-a4a5-b5fdc3a23226@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Phil Bouchard <philippeb8@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Deterministic C++ memory manager
Date: Fri, 4 Aug 2017 21:15:26 -0700 (PDT)
Lines: 251
Approved: news@gmane.org
Message-ID: <c019348f-8a1f-46b3-a4a5-b5fdc3a23226@isocpp.org>
References: <68af3311-d2d7-42ff-8cfd-f8bcdc20bf0c@isocpp.org>
 <da483e72-1a63-4ea1-80c4-8d63aa018db9@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1410_995564218.1501906526670"
X-Trace: blaine.gmane.org 1501906532 15628 195.159.176.226 (5 Aug 2017 04:15:32 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 5 Aug 2017 04:15:32 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCAYTFXFZMBBBX4MSXGAKGQE2ZTWFMY@isocpp.org Sat Aug 05 06:15:24 2017
Return-path: <std-proposals+bncBCAYTFXFZMBBBX4MSXGAKGQE2ZTWFMY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f70.google.com ([209.85.214.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCAYTFXFZMBBBX4MSXGAKGQE2ZTWFMY@isocpp.org>)
	id 1ddqUl-0003Qc-3x
	for gclcip-std-proposals@m.gmane.org; Sat, 05 Aug 2017 06:15:23 +0200
Original-Received: by mail-it0-f70.google.com with SMTP id r9sf29690389ita.7
        for <gclcip-std-proposals@m.gmane.org>; Fri, 04 Aug 2017 21:15:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=yUG7SvNgBvdPyhX1mueNi3qxRBZ3ZSCGAP/PJ4lVfJY=;
        b=AFzgPWOH4Bj1Hb/fV5qXOc8LWrAlth69axXuSRHMh3ocJ/TvQyH1LIYVINxio/xo0n
         8F7TxgYOJYnS5VlP8RGlAjjAE0DJy+fsPt51WOumKPa2XnFeIB63KFVBmztS6FOxrAmW
         GQi5I2n0uX4nxpt+uvHAivWka9gV5VWgS8y1T68YRr2/PRZzMxGYPWcfeaIhSPWw2ARL
         O2HeSMh+S2puwn0UWdw5iAINN9nH5UntLjwJosvsUYn2mcKsM3f5S2lNQU6Hji8WzewB
         /acsCbfjgqfqyTko8+m1O4xZ9R3CL9LhqBIuauzmETaWlGIx0pPQecmeDc0djDtfITvQ
         2RIA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=yUG7SvNgBvdPyhX1mueNi3qxRBZ3ZSCGAP/PJ4lVfJY=;
        b=vePjCrV67cdy/3WedbzlrsPtUqgHGyTuHBkw5TbJGnL3BWEG9DIfoAxGDWOQOJdUgQ
         ZRdfAJx8D8yHSxGzXlqH66l7WFslk1Y09UptlapnGKiWs6YqAMxXPelq7dse+IwSlw8F
         7XRCDOYDlyfdKQGWWJlzZxOHZEZviWPR80MzHwQ8lOk0uuTROlxaNGi0j1jpMgoAlIs4
         hbhOBq22/dkDNbc3eIvH5+IArXVyxzCxAu/afVoMRlmnvDOEdRLeXFGzGlb8ObgkJO6O
         RV4XreevYWDWuNPzACSNLcY1uq/5T81HymR5DWmRUN3SwsSU9D2lvnEY3lCy7X8VX0xa
         ve7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=yUG7SvNgBvdPyhX1mueNi3qxRBZ3ZSCGAP/PJ4lVfJY=;
        b=ZoD9+/oW9Nsxypj7u9drUvJcRpBtB982Xh4yenErUTlDowmD7bpeEcZdNM+5+xmmDR
         ncs5IWaC9rPtLti2HI+xovdvo7t8Ny9veAECSFAUL0NaILZS1IAJQIyfyp5fpKHkcBo1
         wF8r23F7hVIkIwtFFBcSQWpdhfgLZOaePis6LWv5a40g76tmaDyOfa+A4ObLWtXSQdKW
         iQA+dGQZ4uCN9VFcDKd8udjYX/edMy05fuR0h3yXKljXrjd3H+w8Xm5QG9hJ4mMvSCbv
         SWyLPZNy7fLDP0A/tEB9GuhTBOBFMS1DZwn0P+kzf8Bi/yLleWHhoLH4pyO9jINSAO+V
         eACg==
X-Gm-Message-State: AIVw1117rWJaC2MRMZ6CwdXrSWhWky0qddBh8XDnMv1kWT0v4PVoTk3a
	8X7m6e+R+KxyTh2R
X-Received: by 10.107.205.131 with SMTP id d125mr1464484iog.45.1501906528517;
        Fri, 04 Aug 2017 21:15:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.24.69 with SMTP id 66ls4439727ioy.18.gmail; Fri, 04 Aug
 2017 21:15:27 -0700 (PDT)
X-Received: by 10.31.169.17 with SMTP id s17mr22953vke.11.1501906527083;
        Fri, 04 Aug 2017 21:15:27 -0700 (PDT)
In-Reply-To: <da483e72-1a63-4ea1-80c4-8d63aa018db9@isocpp.org>
X-Original-Sender: philippeb8@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:33602
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33602>

------=_Part_1410_995564218.1501906526670
Content-Type: multipart/alternative; 
	boundary="----=_Part_1411_1379060365.1501906526671"

------=_Part_1411_1379060365.1501906526671
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



On Friday, August 4, 2017 at 6:40:45 PM UTC-4, Arthur O'Dwyer wrote:
>
> On Friday, August 4, 2017 at 1:07:31 PM UTC-7, Phil Bouchard wrote:
>>
>> Hi ISO C++,=20
>>
>> I have developed a deterministic memory manager in C++ and I was=20
>> wondering if ISO C++ would be interested to hear more about it.
>>
>> For the moment I have included my solution in a brand new language I cal=
l=20
>> "BB++" because I need to add functionality that C++ doesn't yet have suc=
h=20
>> as:
>> - to add instances of an object implicitly as each scope;
>> - to add implicit references to these objects in top-level classes
>> - to overload 'operator .'
>> - to use 'auto' for member variables instead of 'decltype'
>> - to add metadata of the classes in order to propagate the proxy=20
>> associated to the pointers within those classes
>>
>> The homepage of my project is:
>> https://github.com/philippeb8/root_ptr/tree/bb++/bbpp2cpp
>>
>> And I have a 17 minutes presentation available here:
>> https://youtu.be/GrNDYWyasxg
>>
>> Please let me know if this is the type of research you are interested in=
..=20
>> The work is a step away from being production ready. It has to be noted=
=20
>> that Root.Ptr is already faster than Shared.Ptr in multithreaded mode.
>>
>
> It would help if you could edit down that YouTube video to cut all the=20
> dead air; it's 17 minutes of which the relevant 5 minutes is scattered=20
> around separated by painful silent sections. Even at 200% playback speed,=
=20
> it's a slog.
> Certainly for your present purposes, *nothing* prior to 6m22s is=20
> relevant. (Anyone who cares already knows how mark-and-sweep and=20
> refcounting work, and doesn't need a tutorial on the subject.)
>

Thanks I'll make the corrections this weekend.=20
=20

> You never show code or diagrams for root_ptr in the video, but from the=
=20
> usage example and caveats, I infer that it is (almost?) exactly what Herb=
=20
> Sutter called a "deferred_heap" at CppCon 2016.
>
> https://internals.rust-lang.org/t/herb-sutter-deferred-heaps-and-pointers=
/4183
> Of course everyone has their own implementation of this idea; and there=
=20
> are plenty of hybrids, such as "local arena allocators", or mixing in a b=
it=20
> of refcounting to get Objective-C's "autorelease pools", or mixing in a b=
it=20
> of RCU to get "RCU domains", or whatever.
>

Firstly I would like to point out that I came up with the idea long before=
=20
Microsoft did (2011 actually). You can easily find references to my=20
previous attempts in the development Boost mailing list. Back in the days=
=20
my library was called: "block_ptr" and "shifted_ptr".=20

Secondly deferred_ptr is not production ready and doesn't support=20
multithreading mode whereas root_ptr was correctly unit tested and it does=
=20
support multithreading mode but I just need to optimize one mutex (that is=
=20
currently a static member) to make it even faster.=20

=20

> Starting around 12m45s, the examples seem to be concerned entirely with=
=20
> showing examples of successful escape analysis =E2=80=94 that is, you cre=
ate a=20
> "node_proxy" (a.k.a. deferred_heap) and allocate some objects in that hea=
p,=20
> and then you return a pointer to one of those objects from the current=20
> function. Normally this would cause dangling-pointer/use-after-free error=
s,=20
> but in this case your BB++ language is doing some sort of "escape analysi=
s"=20
> to promote the returned object into the surrounding scope. Some explanati=
on=20
> of this promotion mechanism would be useful, since it's the one thing=20
> that's not obvious how to do in today's C++.
>


I will clarify what is currently happening at that moment in my next video.=
=20
Thanks for your patience.


Regards,
-Phil=20

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/c019348f-8a1f-46b3-a4a5-b5fdc3a23226%40isocpp.or=
g.

------=_Part_1411_1379060365.1501906526671
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, August 4, 2017 at 6:40:45 PM UTC-4, Art=
hur O&#39;Dwyer wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">On Friday, August 4, 2017 at 1:07:31 PM UTC-7, Phil Bouchard wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi ISO C++,
<br><p style=3D"color:rgb(43,46,47);font-family:&quot;Lucida Sans Unicode&q=
uot;,&quot;Lucida Grande&quot;,Tahoma,Verdana,sans-serif;font-size:14px;lin=
e-height:22px;margin-top:15px;margin-bottom:15px" dir=3D"auto">I
 have developed a deterministic memory manager in C++ and I was=20
wondering if ISO C++ would be interested to hear more about it.</p><p style=
=3D"color:rgb(43,46,47);font-family:&quot;Lucida Sans Unicode&quot;,&quot;L=
ucida Grande&quot;,Tahoma,Verdana,sans-serif;font-size:14px;line-height:22p=
x;margin-top:15px;margin-bottom:15px" dir=3D"auto">For
 the moment I have included my solution in a brand new language I call=20
&quot;BB++&quot; because I need to add functionality that C++ doesn&#39;t y=
et have=20
such as:<br>- to add instances of an object implicitly as each scope;<br>- =
to add implicit references to these objects in top-level classes<br>- to ov=
erload &#39;operator .&#39;<br>- to use &#39;auto&#39; for member variables=
 instead of &#39;decltype&#39;<br>- to add metadata of the classes in order=
 to propagate the proxy associated to the pointers within those classes</p>=
<p style=3D"color:rgb(43,46,47);font-family:&quot;Lucida Sans Unicode&quot;=
,&quot;Lucida Grande&quot;,Tahoma,Verdana,sans-serif;font-size:14px;line-he=
ight:22px;margin-top:15px;margin-bottom:15px" dir=3D"auto">The homepage of =
my project is:<br><a href=3D"https://github.com/philippeb8/root_ptr/tree/bb=
++/bbpp2cpp" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D=
&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fphilippeb8%=
2Froot_ptr%2Ftree%2Fbb%2B%2B%2Fbbpp2cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dA=
FQjCNHBbjhv9Q67kOU4n9m2hXdw8tBNUg&#39;;return true;" onclick=3D"this.href=
=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fphilippe=
b8%2Froot_ptr%2Ftree%2Fbb%2B%2B%2Fbbpp2cpp\x26sa\x3dD\x26sntz\x3d1\x26usg\x=
3dAFQjCNHBbjhv9Q67kOU4n9m2hXdw8tBNUg&#39;;return true;">https://github.com/=
philippeb8/<wbr>root_ptr/tree/bb++/bbpp2cpp</a></p><p style=3D"color:rgb(43=
,46,47);font-family:&quot;Lucida Sans Unicode&quot;,&quot;Lucida Grande&quo=
t;,Tahoma,Verdana,sans-serif;font-size:14px;line-height:22px;margin-top:15p=
x;margin-bottom:15px" dir=3D"auto">And I have a 17 minutes presentation ava=
ilable here:<br><a href=3D"https://youtu.be/GrNDYWyasxg" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://youtu.be/GrNDYWyas=
xg&#39;;return true;" onclick=3D"this.href=3D&#39;https://youtu.be/GrNDYWya=
sxg&#39;;return true;">https://youtu.be/GrNDYWyasxg</a></p><p style=3D"colo=
r:rgb(43,46,47);font-family:&quot;Lucida Sans Unicode&quot;,&quot;Lucida Gr=
ande&quot;,Tahoma,Verdana,sans-serif;font-size:14px;line-height:22px;margin=
-top:15px;margin-bottom:15px" dir=3D"auto">Please
 let me know if this is the type of research you are interested in.
 The work is a step away from being production ready. It has to be noted th=
at Root.Ptr is already faster than Shared.Ptr in multithreaded mode.</p></d=
iv></blockquote><div><br></div><div>It would help if you could edit down th=
at YouTube video to cut all the dead air; it&#39;s 17 minutes of which the =
relevant 5 minutes is scattered around separated by painful silent sections=
.. Even at 200% playback speed, it&#39;s a slog.</div><div>Certainly for you=
r present purposes, <i>nothing</i> prior to 6m22s is relevant. (Anyone who =
cares already knows how mark-and-sweep and refcounting work, and doesn&#39;=
t need a tutorial on the subject.)</div></div></blockquote><div><br></div><=
div>Thanks I&#39;ll make the corrections this weekend.=C2=A0<br></div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><=
div>You never show code or diagrams for root_ptr in the video, but from the=
 usage example and caveats, I infer that it is (almost?) exactly what Herb =
Sutter called a &quot;deferred_heap&quot; at CppCon 2016.</div><div><a href=
=3D"https://internals.rust-lang.org/t/herb-sutter-deferred-heaps-and-pointe=
rs/4183" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39=
;https://www.google.com/url?q\x3dhttps%3A%2F%2Finternals.rust-lang.org%2Ft%=
2Fherb-sutter-deferred-heaps-and-pointers%2F4183\x26sa\x3dD\x26sntz\x3d1\x2=
6usg\x3dAFQjCNFDgDPIjrcdGQg_Xmfpsrn_6z2FRg&#39;;return true;" onclick=3D"th=
is.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Finternals.rust=
-lang.org%2Ft%2Fherb-sutter-deferred-heaps-and-pointers%2F4183\x26sa\x3dD\x=
26sntz\x3d1\x26usg\x3dAFQjCNFDgDPIjrcdGQg_Xmfpsrn_6z2FRg&#39;;return true;"=
>https://internals.rust-lang.<wbr>org/t/herb-sutter-deferred-<wbr>heaps-and=
-pointers/4183</a><br></div><div>Of course everyone has their own implement=
ation of this idea; and there are plenty of hybrids, such as &quot;local ar=
ena allocators&quot;, or mixing in a bit of refcounting to get Objective-C&=
#39;s &quot;autorelease pools&quot;, or mixing in a bit of RCU to get &quot=
;RCU domains&quot;, or whatever.</div></div></blockquote><div><br></div><di=
v>Firstly I would like to point out that I came up with the idea long=20
before Microsoft did (2011 actually). You can easily find references to=20
my previous attempts in the development Boost mailing list. Back in the=20
days my library was called: &quot;block_ptr&quot; and &quot;shifted_ptr&quo=
t;.
<br>
<br>Secondly deferred_ptr is not production ready and doesn&#39;t support=
=20
multithreading mode whereas root_ptr was correctly unit tested and it=20
does support multithreading mode but I just need to optimize one mutex=20
(that is currently a static member) to make it even faster.=C2=A0<br></div>=
<div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;=
"><div dir=3D"ltr"><div>Starting around 12m45s, the examples seem to be con=
cerned entirely with showing examples of successful escape analysis =E2=80=
=94 that is, you create a &quot;node_proxy&quot; (a.k.a. deferred_heap) and=
 allocate some objects in that heap, and then you return a pointer to one o=
f those objects from the current function. Normally this would cause dangli=
ng-pointer/use-after-<wbr>free errors, but in this case your BB++ language =
is doing some sort of &quot;escape analysis&quot; to promote the returned o=
bject into the surrounding scope. Some explanation of this promotion mechan=
ism would be useful, since it&#39;s the one thing that&#39;s not obvious ho=
w to do in today&#39;s C++.</div></div></blockquote><div><br></div><div><br=
></div><div>I will clarify what is currently happening at that moment in my=
 next video. Thanks for your patience.</div><div><br></div><div><br></div><=
div>Regards,</div><div>-Phil=C2=A0</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c019348f-8a1f-46b3-a4a5-b5fdc3a23226%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c019348f-8a1f-46b3-a4a5-b5fdc3a23226=
%40isocpp.org</a>.<br />

------=_Part_1411_1379060365.1501906526671--

------=_Part_1410_995564218.1501906526670--

.
