[fpc-pascal] Thread Safety of String

Saunders, Rich greymont at mykolab.com
Wed Jun 4 20:13:51 CEST 2014


On 2014-06-04 13:22, md at rpzdesign.com wrote:
> I guess what I was really asking is:
> 
> Is there a way to treat an array of chars as a string.
> 
> I like the string handling patterns of freepascal but I want
> the memory stability of a static array of chars
> so I can be used in multi-thread operations without
> a lot a critical section considerations.

Short strings (those declared with a defined length) are not as dynamic 
as you fear. They should stay in place while you change their values.

The String type (declared without defined length) is the one that is 
dynamic and reference counted.

-- 

Cheers!
Rich Saunders



More information about the fpc-pascal mailing list