[Lazarus] thread safe
Mattias Gaertner
nc-gaertnma at netcologne.de
Tue Jun 14 12:02:17 CEST 2011
On Tue, 14 Jun 2011 11:53:14 +0200
Michael Schnell <mschnell at lumino.de> wrote:
> On 06/10/2011 06:09 PM, Mattias Gaertner wrote:
> >
> > Sigh. It already does. See my TThreadList.Add example.
> This example shows that it does not make sense.
>
> (Supposedly) TThreadList.Add is "separate-instance-thread safe" (each thread can create an instance and use the "Add" procedure without risking a conflict).
>
> TThreadList.Add is not "cross-instance-thread safe" (multiple threads using the same instance's "Add" procedure will result in erroneous behavior).
Why do you think so?
> Simply stating that TThreadList.Add is "not thread save" (which of course is perfectly correct) would prevent using a TThreadList as a data store e.g. in a thread class that itself is instantiated multiple times. There using TThreadList would be overkill.
Mattias
More information about the Lazarus
mailing list