Fully transitive const is not necessary

Jason House jason.james.house at gmail.com
Wed Apr 2 05:09:03 PDT 2008


My point is that global variables violate the guarantee transitive const provides... My question is how having them as an exception does not invalidate the whole argument that transitive const is needed for multithreading. I view global variables the same as head const.

Walter Bright Wrote:

> Jason House wrote:
> > Walter Bright wrote:
> > And how do global variables fit into that?  Technically, they're always
> > reachable and never inherit const.
> 
> If the global variables are not invariant, then you're going to have 
> synchronization problems when accessing them from multiple threads. If 
> they are invariant, you cannot have sync problems.




More information about the Digitalmars-d mailing list