[fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

Marco van de Voort marcov at stack.nl
Mon Aug 31 10:06:23 CEST 2009


In our previous episode, Graeme Geldenhuys said:
> >> I just need confirmation that the current implementation in FPC is 
> >> incorrect though.
> > 
> > It's not incorrect, just inefficient.
> 
> I have to disagree. The currently class name is
> TMultiReadExclusiveWriteSynchronizer. The currently implementation does
> NOT allow multi-read (so the class name totally misleading). It uses a
> simple Critical Section to block any other threads while reading or writing.

This is already known since the beginning. It is just an initial implementation
to ease porting.
  
> At least, the FPC team needs to rename the class to TSimpleRWSync (to be
> Delphi compatible with the same functionality).

Sure. I didn't know TSimple*, otherwise i'd suggest to simply delete it, it
was always meant as a placeholder.

But only when there is a validated, portable substitute. Since though
limited and inefficient, the current implementation keeps codebases running.



More information about the fpc-pascal mailing list