[fpc-devel] ref count types / threadsave question

Jonas Maebe jonas at freepascal.org
Sun Jan 6 13:19:52 CET 2019

On 04/01/19 00:11, Benito van der Zander wrote:
> Hi Fpc Developers',
>> Nobody is talking about the string content. 
> But when they are stored together, that is the same. You can't get one 
> without the other.

You can, since the data can be stored in a different cache line than the 
refcount. But the principle is indeed the same: the data is not 
guaranteed to be synchronised across cores either.

> Sure one core can read 2 after the other core wrote 1.
> I do not see how a core can read 1 after a 2 was written.

There is no difference between the two cases as long as the second read 
happens without an atomic read-modify-write operation..


More information about the fpc-devel mailing list