[fpc-pascal] Is TFPList thread safe?

Michael Van Canneyt michael at freepascal.org
Thu Oct 2 08:16:10 CEST 2014



On Thu, 2 Oct 2014, Xiangrong Fang wrote:

> Hi,
> 
> I would like to know if TFPList is thread-safe or not? And if I make a component thread-safe by using critical sections etc. Is the performance penalty noticeable? 

TFPList is not thread-safe. You need to use TThreadList if you want a thread-safe list.

Critical sections use OS calls, so there is always a performance penalty.

Michael.


More information about the fpc-pascal mailing list