[fpc-pascal] Thread Safety of String
Saunders, Rich
greymont at mykolab.com
Wed Jun 4 21:03:31 CEST 2014
On 2014-06-04 14:42, md at rpzdesign.com wrote:
> For anybody who has followed this thread, there is some disagreement
> over the thread safety of shortstrings. And in this case, a
> shortstring
> with a clearly defined maximum length.
>
> Some have clearly said string[30] is NOT thread safe.
>
> Rich indicated below he feels they ARE SAFE.
You have misinterpreted by comment. I was pointing out that short
strings are more static than the String type and not the as dynamic as
the earlier message indicated. When you assign a new value it is placed
in the same memory location as the previous value. This is not always
the case with the String type.
Whether static variables are more or less thread safe is for you to
decide since you know what you are doing with them. I don't think either
short strings or Strings are inherently more or less thread safe. It
depends on what you do with them.
--
Cheers!
Rich Saunders
More information about the fpc-pascal
mailing list