<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/02/2014 03:02 AM, Xiangrong Fang
wrote:<br>
</div>
<blockquote
cite="mid:CAP93jB1zQ4X-GW-eMccfpEXrShb4NyFXYw9Oq_HE9W+WOHB1MA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-family:courier
new,monospace">Hi,</div>
<div class="gmail_default" style="font-family:courier
new,monospace"><br>
</div>
<div class="gmail_default" style="font-family:courier
new,monospace">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?
<br>
</div>
</div>
</blockquote>
For a class, Thread save" is not that easily defined. <br>
<br>
e.g.: <br>
<br>
It can be fully thread save (like TThreadList): you can call any
function/property at any time from any thread.<br>
It could be allowed to create multiple instances in multiple threads
and use each of them with it's own thread but not with others (holds
for TList)<br>
It could be allowed to crate an instance with one thread and after
that use functions/properties with a single other one. (e.g.: TList)<br>
it could be allowed to use all instances of the class only in a one
and only thread. <br>
It could be allowed to be used only in a predefined (e.g. the main-)
thread (many classes in the LCL).<br>
...<br>
<br>
-Michael<br>
</body>
</html>