Re: [fpc-devel] WriteBarrier

2020-08-24 Thread Martin Frb via fpc-devel
On 24/08/2020 19:22, Jonas Maebe via fpc-devel wrote: On 24/08/2020 19:20, Jonas Maebe via fpc-devel wrote: It's not paranoid, it is the only correct way to write the code. * if you don't want to use regular synchronisation primitives, like mutexes/signals/events/... I have events in some

Re: [fpc-devel] WriteBarrier

2020-08-24 Thread Jonas Maebe via fpc-devel
On 24/08/2020 19:20, Jonas Maebe via fpc-devel wrote: > It's not paranoid, it is the only correct way to write the code. * if you don't want to use regular synchronisation primitives, like mutexes/signals/events/... Jonas ___ fpc-devel maillist -

Re: [fpc-devel] WriteBarrier

2020-08-24 Thread Jonas Maebe via fpc-devel
On 24/08/2020 02:11, Martin via fpc-devel wrote: > Assuming the following >  (and not counting on Interlocked... doing any Barriers itself) > > Thread 1 >   Foo := val; // normal assign >   WriteBarrier; // make sure above write to Foo is executed, before the > next write to flag >  

[fpc-devel] WriteBarrier

2020-08-23 Thread Martin via fpc-devel
Ok, I got a bit further. Assuming the following  (and not counting on Interlocked... doing any Barriers itself) Thread 1   Foo := val; // normal assign   WriteBarrier; // make sure above write to Foo is executed, before the next write to flag   InterLockedIncrement(Flag);  // needed for the