On 06/04/2014 08:04 PM, joha...@nacs.net wrote:
 I would expect shortstring might be thread safe.
Only a simple write (not a modification) of processor-native types is inherently atomic and thus really thread save.

So I suspect that even Int64 is not thread save (in this sense) on 32 bit CPUs: a simple write to a memory based variable is doner in two steps and so could be preempted by the other thread, but is on a 64 bit CPU.

A modification of course is even worse (here you can use "atomic" functions provided by the RTL).

Obviously a short string can't be re-written in a single instruction.

-Michael
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to