D1.5 anyone?

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Apr 13 05:50:08 UTC 2023


On 13/04/2023 5:06 AM, Walter Bright wrote:
>> In both of those cases its owned by the thread. With @safe they would 
>> be scope, which is a partial implementation of 'owned by thread' 
>> checking.
> 
> Then I don't know what you mean by default being shared. And why would 
> @safe influence this?

Default being shared I mean in terms of equivalence of behavior and 
purpose of shared itself.

@safe influences it because of DIP1000 with scope, which gives memory a 
lifetime that is tracked across a thread.

>> A better example would be `a`. This is an argument, with an unknown 
>> memory lifetime or ownership, that should be shared implicitly even if 
>> it was marked scope.
> 
> Such implicit sharing means C semantics, where the compiler assumes that 
> none of it is shared, and there are no protections and it's all up to 
> the programmer to put in synchronization code where necessary.
> 
> You can actually do that now in D, just leave off the 'shared' annotations.

Exactly. You can leave it off and you have the same guarantees you have 
with shared being on (ignoring nosharedaccess as that is essentially 
turning it into atomic without any of the QoL stuff).

We can talk about this some other time perhaps at a BeerConf if you're 
on when I can talk. I do have a lot of things to talk about that are a 
bit exciting (and plenty of bugs like unresolved RTInfoImpl's with dmd)!


More information about the Digitalmars-d mailing list