Re: how to cast away 'volatile'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Haley <aph@xxxxxxxxxx> writes:

> I didn't mean to suggest that volatile would necessarily be
> sufficient, but that it would be necessary.  Surely the compiler needs
> to know that the buffer is volatile, or what's to stop it re-ordering
> accesses around the asm statements that are the memory barriers?  I
> know that in gcc we add a memory clobber to such asms, but that isn't
> generally true.  OK, if we have POSIX threads we also have POSIX
> mutexes...

Right: you have to use a mutex for correctness, and the mutex has to
be magic.  And once you use a magic mutex, using volatile doesn't make
any difference.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux