[fpc-pascal] Is TFPList thread safe?
Xiangrong Fang
xrfang at gmail.com
Thu Oct 2 17:03:27 CEST 2014
2014-10-02 22:23 GMT+08:00 Xiangrong Fang <xrfang at gmail.com>:
>
> 2014-10-02 22:09 GMT+08:00 Michael Schnell <mschnell at lumino.de>:
>
>>
>> AFAIR, in Linux, the fpc RTL calls the pthread library "mutex..."
>> function. This library uses Futex, if the arch supports that, and uses the
>> plain old MUTEX system call if the arch does not support FUTEX.
>
>
I found some quotes online:
For Windows, critical sections are lighter-weight than mutexes.
> Mutexes can be shared between processes, but always result in a system
> call to the kernel which has some overhead. Critical sections can only be
> used within one process, but have the advantage that they only switch to
> kernel mode in the case of contention.
I only need lock WITHIN my own application, so, it seems that critical
sections are better.
Xiangrong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20141002/800944be/attachment.html>
More information about the fpc-pascal
mailing list