Graeme Geldenhuys schrieb:
> Hi,
> 
> The current TMultiReadExclusiveWriteSynchronizer as implemented in FPC
> 2.3.1 is wrong. It use Critical Sections in a standard way which means
> it blocks all other threads while one thread is doing a Read. This is
> wrong.  It is a MULTI read, SINGLE write synchronizer. So it must only
> block other thread is a Write is in progress. But allow multiple reads
> while no Write is in progress.

It is on the safe side but it is not optimal.

> 
> The TMultiReadExclusiveWriteSynchronizer is currently equivalent to the
> Delphi 7 TSimpleRWSync class, not the Delphi
> TMultiReadExclusiveWriteSynchronizer class.
> 
> 
> I have a corrected TMultiReadExclusiveWriteSynchronizer implementation
> (don't worry, not based on Delphi implementation) that I can donate to
> FPC. I just need confirmation that the current implementation in FPC is
> incorrect though.

If you have a better for unix this will be fine. IIRC it is not easy (if
possible after all?) to implement TMultiReadExclusiveWriteSynchronizer
for unix systems.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to