On 06/01/19 14:42, Martin Frb wrote:
Btw about threads seeing different cached versions of data.
What happens in case of synchronize?
Synchronize uses an RtlEvent. That one uses OS primitives that include
memory barriers, so the data will be properly synchronised across cores.
If so then how to I ever get a managed variable safely into a thread?
(Once the thread was started).
It behaves the same as any other data.
In general: always use an RTLEvent, mutex, critical section or similar
to access shared data. Those will ensure that the necessary memory
barriers get inserted.
Jonas
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel