[fpc-pascal] Getting the state of a TRTLCriticalSection
Marco van de Voort
marcov at stack.nl
Mon Oct 7 11:33:45 CEST 2013
In our previous episode, Jonas Maebe said:
> > I used the interlocked increment/decrement, which- as I understand
> > it- should handle membar itself on architectures that can benefit
> > from it.
>
> They do not include any memory barrier. The only thing those routines
> guarantee on all platforms, is that the value is atomically
> incremented/decremented.
(btw that depends on which functions you mean, our own assembler versions
probably.
The Windows
functions of the same name are guaranteed to have memory barriers afaik,
but do require alignment. (probably to avoid crosssing cache lines)
)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683614%28v=vs.85%29.aspx
More information about the fpc-pascal
mailing list