Escaping the Tyranny of the GC: std.rcstring, first blood

po via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 15 12:43:41 PDT 2014


> As I understand the issue it works if you make sure to transfer 
> ownership explicitly before the other thread gains access?
>
> Maybe this is more clear:
>
> http://www.1024cores.net/home/lock-free-algorithms/object-life-time-management/differential-reference-counting

  Ah, I think I follow.

So in C++ terms:
  It basically requires either a global shared_ptr, or that you 
passed one around by reference between threads. And that you then 
killed it in one thread at the exact moment the control block was 
read in another thread. That blog post discusses a solution, I 
wonder if that is implemented in C++'s shared_ptr?




More information about the Digitalmars-d mailing list