synchronous class [Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables]
Martin Friebe
fpc at mfriebe.de
Thu Jul 31 12:16:47 CEST 2008
IMHO per class may create some problems? but maybe I am just overlooking
something?
TBar =class( TFoo ) end synchronized class;
Let's say TFoo was declared in another unit, and TFoo was not declared
Synchronized. Then TFoo code can be entered by anyone at any time.
Even if a thread is in TBar. How would one make sure, that a base class,
knows about all classes that inherit from it?
Neither can you say the baseclass must also be "synchronous class",
because ultimately there always is TObject. and TObject does not want to
be Synchronous class, or all Create/destroy would be in critical sections?
It my be possible to work around, this, but it would probably create a
ig overhead, as every method one very class would have to perform checks
at runtime.
Similar for instance wide protection.
Regards
Martin
Michael Schnell wrote:
>
>> Per class. The question is if it's possible to do this per class
>> instance too.
> To me "Per class" does not seem appropriate at all. "Per instance" in
> fact seems to make sense.
>
> -Michael
> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
More information about the fpc-devel
mailing list