shared: Has anyone used it without a lot of pain?

Guillaume Piolat via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 5 07:01:24 PDT 2017


On Wednesday, 5 April 2017 at 13:18:26 UTC, Andrea Fontana wrote:
> On Tuesday, 4 April 2017 at 21:56:37 UTC, Atila Neves wrote:
>> I feel dirty if I write `__gshared`. I sneeze when I read it. 
>> But everytime I try and use `shared` I get trouble for it.
>> [...]
>> Atila
>
> https://p0nce.github.io/d-idioms/#The-truth-about-shared

Do we have a missed opportunity with shared?

My pet peeve with shared is the RoI.
You were supposed to use it whenever something is "shared across 
threads". My problem with it is with the RoI of putting entire 
object graphs under that type constructor.

For now it seems shared!T is about being a monadic hatch for the 
adventurous, one you can bring your own meaning for.


More information about the Digitalmars-d mailing list