[fpc-devel] volatile variables
henry.vermaak at gmail.com
Tue Jun 28 16:20:57 CEST 2011
On 28/06/11 15:09, Andrew Brunner wrote:
>> Of course it is. They issue a hardware memory barrier. This stops the cpu
>> from reordering operations. How do you think anything using pthreads will
>> work if they didn't?
> Documentation please? If what you are saying is accurate just point
> me to the documentation?
Jonas already pointed you to it:
"Applications shall ensure that access to any memory location by more
than one thread of control (threads or processes) is restricted such
that no thread of control can read or modify a memory location while
another thread of control may be modifying it."
Please note the "read or modify". If you fail to understand this, you
can read the source of a posix threads implementation, e.g. nptl (which
is part of libc).
More information about the fpc-devel