Running circles around TMultiReadExclusiveWriteSynchronizer

Running circles around TMultiReadExclusiveWriteSynchronizer
http://www.delphitools.info/2013/12/09/slim-multi-read-single-write-locks/

Comments

  1. There is so much Delphi library code that needs a proper overhaul!

    ReplyDelete
  2. Maybe they just need a site for reporting such things. Could call it QC.... no, wait.

    ReplyDelete
  3. Could this comparison be true for all versions of Delphi? D2009 for instance

    ReplyDelete
  4. I don't think TMultiReadExclusiveWriteSynchronizer got any noteworthy changes in a long while, but someone with access to the RTL source of several version should be able to confirm with a diff.

    ReplyDelete
  5. I use MREWs quite heavily in one of my apps, now I'm thinking of running some tests and swapping them out for Critical Sections to see what the difference would be.

    ReplyDelete
  6. Back around 2000 when I had a dual Celeron rig (Asus BP6, good times), I tested the MREW in Delphi against a plain TCriticalSection for a cache structure, with a query/insert ratio of about 100-1000:1 depending on workload. Inserts were lengthy as a computation had to be performed while the structure was locked (for implementation reasons).

    The critical section was significantly faster back then, and no less significantly had not all the documented deadlock bugs that MREW had. I guess the bugs may be gone, but I see the speed hasn't improved much...

    BTW Boost has had issues with their MREW implementation as well. Due to the tricky nature of these beasts I tend to apply the KISS principle and go with critical sections.

    ReplyDelete

Post a Comment