[Lazarus] thread safe

Andrew Brunner andrew.t.brunner at gmail.com
Mon Jun 27 16:17:37 CEST 2011


2011/6/27 Michael Schnell <mschnell at lumino.de>:
> This is clear. You also would have been able to avoid the problem by using
> critical sections around all the appropriate instructions, but supposedly
> this would have slowed done the application greatly.
>

I disagree.  In my experience critical sections only employ a
spin-count per entrance into the block.  TCriticalSection is a
particialar method to ensure a code block is only accessed by one
thread at a time.  I strongly believe it does not ensure a "core stay"
during execution.  See the link at wikipedia.  It clearly explains the
issue of multi-core situations.




More information about the Lazarus mailing list