Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-31 Thread Marco van de Voort
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

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-31 Thread Graeme Geldenhuys
Vinzent Höfler wrote: > Graeme Geldenhuys : > >> I have a corrected TMultiReadExclusiveWriteSynchronizer >> implementation (don't worry, not based on Delphi implementation) >> that I can donate to FPC. > > I hope it isn't based on the Delphi one. Last time I heard the Delphi > implementation suff

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-29 Thread Marco van de Voort
In our previous episode, Florian Klaempfl said: > > (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

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-29 Thread Vinzent Höfler
Florian Klaempfl : > 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. It's possible, yes. If it's possible in an efficient way, is another question. Vinzent. -- GRATIS für alle

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-29 Thread Vinzent Höfler
Graeme Geldenhuys : > I have a corrected TMultiReadExclusiveWriteSynchronizer implementation > (don't worry, not based on Delphi implementation) that I can donate to > FPC. I hope it isn't based on the Delphi one. Last time I heard the Delphi implementation suffers from occasional dead locks. S

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-28 Thread Florian Klaempfl
Jonas Maebe schrieb: > > On 28 Aug 2009, at 10:35, Florian Klaempfl wrote: > >> 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. > > What's wrong with these routines: pthread_rw

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-28 Thread Jonas Maebe
On 28 Aug 2009, at 10:35, Florian Klaempfl wrote: 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. What's wrong with these routines: pthread_rwlock_init, pthread_rwlock_rdlock/

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-28 Thread Florian Klaempfl
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 sy

[fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-28 Thread Graeme Geldenhuys
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