DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

Dicebot m.strashun at gmail.com
Fri May 17 00:56:49 PDT 2013


On Thursday, 16 May 2013 at 19:52:51 UTC, Jonathan M Davis wrote:
> On Thursday, May 16, 2013 11:13:27 Regan Heath wrote:
>> So, who's responsibility is it to ensure the function/method 
>> call executes
>> without errors caused by mutable shared data?
>
> I think that for the most part, the question of thread-safety 
> and const that
> you've been discussing is moot. const by itself is thread-local 
> by definition.
> Whether you use const or immutable really has no impact on 
> thread safety - not
> from the perspective of the function being called anyway. The 
> only way that
> you can end up having to worry about thread-safety in such 
> functions is if the
> caller casts away shared on a variable and then passes it to 
> the function.

Very good point. "shared" has been paid minimal attention lately 
and I keep forgetting it actually can be used :)


More information about the Digitalmars-d-announce mailing list