[fpc-pascal] Thread Safety of String

Michael Schnell mschnell at lumino.de
Thu Jun 5 09:51:05 CEST 2014


On 06/05/2014 09:42 AM, Mattias Gaertner wrote:
>
>> Only a simple write (not a modification) of processor-native types is
>> inherently atomic and thus really thread save.
> No.
What do you want to say by "No" ?
  - even a simple write might be not thread save or
  - also more complex writes are thread save
("thread save" in the sense that a write of the value can't be 
interrupted by another thread and hence the other thread always reads 
the coherent value - either the one before the writing or the one after 
writing)

> See for example
> http://en.wikipedia.org/wiki/Memory_barrier
I understand that the implementation of memory barriers is architecture 
specific and in a portable code you can't rely on a desired behavior.

-Michael



More information about the fpc-pascal mailing list