DMD 1.029 and 2.013 releases

Walter Bright newshound1 at digitalmars.com
Thu Apr 24 11:28:44 PDT 2008


Sean Kelly wrote:
> Every tool can be mis-used with insufficient understanding.

Of course. But successfully writing multithreaded code that uses shared 
memory requires a level of expertise that is rare, and the need to write 
safe multithreaded code is far greater than the expertise available.

Even for those capable of doing it, writing correct multithreaded code 
is hard, time-consuming, resistant to testing, and essentially 
impossible to prove correct. It's like writing assembler code with a hex 
editor.


> Look at shared-
> memory multiprogramming for instance.  It's quite easy and understandable
> to share a few data structures between threads

It is until one of those threads tries to change the data.

> (which I'd assert is the original
> intent anyway), but common practice among non-experts is to use mutexes
> to protect code rather than data, and to call across threads willy-nilly.  It's
> no wonder the commonly held belief is that multiprogramming is hard.

The "multiprogramming is hard" is not based on a misunderstanding. It 
really is hard.


> Regarding lock-free programming in particular, I think it's worth pointing
> out that leaving out support for lock-free programming in general excludes
> an entire realm of code being written--not only library code to be ultimately
> used by everyday programmers, but kernel code and such as well.  Look at
> the Linux source code, for example.

I agree that lock free programming is important, but volatile doesn't 
get you there.


 >  As for the C++0x discussions, I feel
 > that some of the participants of the memory model discussion are experts
 > in the field and understand quite well the issues involved.

Yes, there are a handful who do really understand it (Hans Boehm and 
Herb Sutter come to mind). If only the rest of us were half as smart <g>.


More information about the Digitalmars-d-announce mailing list