DIP 1024---Shared Atomics---Final Review

Steven Schveighoffer schveiguy at gmail.com
Tue Dec 10 14:53:51 UTC 2019


On 12/10/19 7:18 AM, RazvanN wrote:
> On Sunday, 8 December 2019 at 16:25:21 UTC, Mike Parker wrote:
> 
> If you have a const shared variable, do you still need locks to read it?
> 
> 

To be consistent, I'd say you'd need at least a cast. Do you need a 
lock? I don't think so for something that has a const storage class.

Note that the DIP does not address whether you need a lock for anything, 
it just says you can't use it in it's "shared" form, you need to cast 
away shared or use a function that does this internally.

-Steve


More information about the Digitalmars-d mailing list