DIP 1024--Shared Atomics--Community Review Round 1

Stefan Koch uplink.coder at googlemail.com
Fri Oct 4 12:22:16 UTC 2019


On Friday, 4 October 2019 at 10:12:45 UTC, Kagamin wrote:
> On Thursday, 3 October 2019 at 12:14:30 UTC, Stefan Koch wrote:
>> A coworker of mine (Don Clugston) came up with this analogy.
>> Multi-threading is a bit like radiating material, you put it 
>> in a safe-box, and put a warning sticker on it, such that only 
>> professionals may open it.
>> And even the professional would not want to be around the 
>> material for very long and certainly would want to be warned 
>> before he accesses the material.
>> Therefore the material should be in it's designated box sealed 
>> away fore the majority of the time.
>
> Sounds like that coworker wants @safe code. The DIP is 
> justified for safe code, but not for system code. Also the DIP 
> provides memory safety, not thread safety.

The reason why you want shared access to be forbidden by default 
is to see where synchronization is required and force you to 
think about it.
In all your code not just safe code.


More information about the Digitalmars-d mailing list