DMD 1.029 and 2.013 releases

0ffh frank at youknow.what.todo.interNETz
Thu Apr 24 16:17:56 PDT 2008


Walter Bright wrote:
> 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.

Just out of curiosity, which approach would you recommend to ensure
that a variable which is updated from an interrupt service routine
(and, implicitly, any other thread) will be read from common memory
and not cached in a register?
I know there are a few, but which would you recommend?
I think ensuring that memory access happens at every variable access
is a straightforward solution (and a good one, if access is atomar).

Regards, frank


More information about the Digitalmars-d-announce mailing list