Fully transitive const is not necessary

Don Clugston dac at nospam.com.au
Wed Apr 2 00:28:18 PDT 2008


Walter Bright wrote:
> Bill Baxter wrote:
>> If the ultimate goal is support for multiprogramming, then shouldn't 
>> the detailed design work should start *there*, with how to do great 
>> multiprogramming?  Rather than with const.
>>
>> Not saying that you guys have done this, but I know from my own 
>> experience doing research that it's easy to get hung up trying to 
>> solve a tough but solvable problem that seems relevant for getting 
>> from A to B, only to realize in the end that it was not as relevant as 
>> I thought.
> 
> I think it is fairly obvious that transitive invariant (and const) is 
> key to multiprogramming. The transitive closure of the state of 
> everything reachable through an object is part of the state of that 
> object, and all the troubles with multiprogramming stem from the state 
> of an object changing asynchronously.

There are two very different aspects to the multiprogramming problem though:
* make it correct
* make it fast.

As far as I can tell, it's like any optimisation problem -- it's only 5-10% of 
the code that matters: it's only necessary to use multiple cores efficiently in 
a small fraction of the code (obviously the entire code needs to be correct). So 
I'm a little uneasy about arguments for const based on efficiency concerns -- 
there are many opportunities to worry about stuff which is ultimately 
irrelevant. I hope that's not happening here.



More information about the Digitalmars-d mailing list