[Lazarus] thread safe
Andrew Brunner
andrew.t.brunner at gmail.com
Mon Jun 27 20:03:16 CEST 2011
On Mon, Jun 27, 2011 at 12:52 PM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> You forget the strength of protection. A MB will disallow immediately any
> concurrent access to the memory area - no way around. Protection by other
> means only can work in *perfect* cooperation, a very weak model.
Absolutely incorrect.
entercricitalsection();
loop
a:=b+c;
end loop;
leavecriticalsection();
thread 2
can read a and b and c at any state. If you want an accurate view of
a,b,c you need to employ interlocked statements :-)
More information about the Lazarus
mailing list