DMD 1.029 and 2.013 releases

Sean Kelly sean at invisibleduck.org
Thu Apr 24 10:51:19 PDT 2008


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> Steven Schveighoffer wrote:
> > You can sort of work around it by wrapping the previously volatile statement
> > in a function, but it seems like having volatile doesn't really hurt
> > anything.  I'm curious to know why it was so bad that it was worth
> > removing...
> Because after listening in while experts debated how to do write
> multithreaded code safely, it became pretty clear that the chances of
> using volatile statements correctly is very small, even for experts.
> It's the wrong approach.

Every tool can be mis-used with insufficient understanding.  Look at shared-
memory multiprogramming for instance.  It's quite easy and understandable
to share a few data structures between threads (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.

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.  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.


Sean


More information about the Digitalmars-d-announce mailing list