Rethinking the default class hierarchy: Milestone 1, Week 1
Bruce Carneal
bcarneal at gmail.com
Thu Sep 30 02:49:24 UTC 2021
On Wednesday, 29 September 2021 at 21:40:11 UTC, Sebastiaan Koppe
wrote:
> On Wednesday, 29 September 2021 at 16:11:24 UTC, Petar Kirov
> [ZombineDev] wrote:
>> When is the last time you saw a Druntime, Phobos, or in
>> general, D function that took a `shared` class reference? (Not
>> a completely rhetorical question - I'd be interested to know
>> if people have such instances in their projects.) Outside of
>> `core.sync.*`, `std.concurrency` and `std.parallelism` nothing
>> deals with `shared` classes.
>
> I tend to use the shared annotation a lot in our concurrency
> library. Structs and delegates mostly though, but it has some
> classes as well.
>
> Obviously it is the sane thing to do once you have multiple
> execution contexts with shared state.
>
> I guess not many people have that though
Like Sebastiaan, I also use shared quite a bit. It helps keep
things sorted if you need/want to roll your own multi-core flows.
More information about the Digitalmars-d
mailing list