Skip to Main Content
Mastering Delphi Programming: A Complete Reference Guide
book

Mastering Delphi Programming: A Complete Reference Guide

by Primož Gabrijelčič
November 2019
Beginner to intermediate content levelBeginner to intermediate
674 pages
15h
English
Packt Publishing
Content preview from Mastering Delphi Programming: A Complete Reference Guide

Comparing reader-writer implementations

To compare different implementations, I have prepared a test program called ReadersWriterLock stored in the Readers-writer lock folder. This program starts six reader threads that process a shared list and one writer thread that modifies this list ten times per second.

A method, RunTests, which you can look up in the code, accepts a IReadWriteSync interface and runs the tests on it. The form contains three buttons, each one to run tests on a specific implementation, as follows:

procedure TfrmReadersWriter.btnMREWClick(Sender: TObject);begin  RunTests('TMREWSync', TMREWSync.Create);end;procedure TfrmReadersWriter.btnSimpleRWClick(Sender: TObject);begin RunTests('TSimpleRWSync', TSimpleRWSync.Create); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Delphi GUI Programming with FireMonkey

Delphi GUI Programming with FireMonkey

Andrea Magni
Delphi Cookbook - Third Edition

Delphi Cookbook - Third Edition

Daniele Spinetti, Daniele Teti

Publisher Resources

ISBN: 9781838989118Other