On 02/01/2019 21:52, Jonas Maebe wrote:
This is a different issue. Managed types are indeed only threadsafe as
long as there is no race condition that could cause their refcount to
become zero at some point.
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.
Yes, I did drop the optimization idea after your first reply.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel