New SPARC definition, and volatile

Doug Gwyn gwyn at smoke.brl.mil
Wed Mar 27 08:11:48 AEST 1991


In article <CX8AUM7 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>If "volatile" implies the use of a "store barrier" instruction on writes,
>this would impact the performance of software that's using volatile to
>(for example) synchronise lightweight processes on a single CPU, but to
>not use it would break s/w that's using spinlocks for multiprocessor
>synchronisation.

I come from the school of thought that says that there is no simple way
to satisfy all concurrent programming needs by a simple hack to an
existing sequential language such as C.  In particular, "volatile" is
not necessarily the proper mechanism for this.  There is no C standard-
imposed requirement to tie generation of "store barrier" instructions
to accesses to volatile objects in such an implementation.  Indeed,
concurrency (other than asynchronous signal handlers) is entirely
outside the scope of the C standard, and deliberately so.



More information about the Comp.lang.c mailing list