Precise GC state

Dmitry Olshansky dmitry.olsh at gmail.com
Mon Nov 27 06:47:00 UTC 2017


On Monday, 27 November 2017 at 06:36:27 UTC, Ola Fosheim Grostad 
wrote:
> On Monday, 27 November 2017 at 05:47:49 UTC, Dmitry Olshansky 
> wrote:
>> likely via RAII. Not to mention cheap (thread-local) Ref 
>> Counting, C++ and many other language have to use atomics 
>> which makes RC costly.
>
> No, you dont. Nobody in their right mind would do so in C++ as 
> a general solution. Seems there is trend in doing D-advocacy 
> based on the assumption that programmers using other languages 
> are crazy these days.

Last time I check shared_ptr can be safely shared across threads, 
hence RC is takling synchronization and most likely atomics since 
locks won’t be any better.

>
> In C++ sync is manual, which is the only efficient way to do

??? shared_ptr is nowhere manual.

Sorry but the rest of the of post is take a direction into the 
fog, that I don’t want to follow.

My post is about particular primitive in C++ std, what could be 
done instead or in addition to is not important.




More information about the Digitalmars-d mailing list