Sharing in D

downs default_357-line at yahoo.de
Thu Jul 31 01:00:59 PDT 2008


Walter Bright wrote:
> Steven Schveighoffer wrote:
>> I would hazard to guess that adopting this would cause a larger rift
>> than const.

He's probably right.

> 
> Perhaps. But the alternative is the current wild west approach to
> multithreaded programming. With the proliferation of multicore
> computers, the era where this is acceptable is coming to an end.
> 

Since when is it the language's job to tell us what's acceptable and what's not?
> But still, you're far better off than the current wild west approach
> where everything is implicitly shared with no protection whatsoever. The
> popular double checked locking bug will be impossible to code in D
> without stuffing in explicit casts. The casts will be a red flag that
> the programmer is making a mistake.
> 

The double checked locking "bug" is only a bug on certain architectures, none of which D is supported on.

What's the point here again?

 --downs



More information about the Digitalmars-d mailing list