[fpc-devel] ref count types / threadsave question
pascaldragon at googlemail.com
Thu Jan 3 14:23:32 CET 2019
Am Do., 3. Jan. 2019, 13:25 hat Benito van der Zander <benito at benibela.de>
> The issue I was talking about is the fact that atomic operations do
> function as global memory synchronisation operations across all cores (at
> least not on all architectures). If core 1 atomatically increases refcount
> to two and you "then" load the same refcount normally (without an atomic
> read-modify-exchange oepration) on another core, this other core may still
> see the old value.
> Is that really so?
> The ref count is stored in the same memory block as the string itself.
> If core 2 could not see the new ref count, it could not see what is in the
> string and thus not use the string for anything .
Nobody is talking about the string content. It's only about the reference
count right now and that one *can* differ between cores if that isn't
correctly handled (even if the string content stays the same).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel