Multithreading - The Delphi Way - Part 1

Martin Harvey.

Skip to Part 2.

Table of Contents.

Recommended Reading.
Navigation hints.
Change history.

Chapter 1. What are threads? Why use them?
Chapter 2. Creating a thread in Delphi.
Chapter 3. Basic synchronization.
Chapter 4. Simple thread destruction.
Chapter 5. More thread destruction. Deadlock.
Chapter 6. More synchronization: Critical sections and mutexes.
Chapter 7. Mutex programming guidelines. Concurrency control.
Chapter 8. Delphi thread safe classes and Priorities.
Chapter 9. Semaphores. Data flow scheduling. The producer - consumer relationship.
Chapter 10. I/O and data flow: from blocking to asynchronous and back.
Chapter 11. Synchronizers and Events.
Chapter 12. More Win32 synchronization facilities.
Chapter 13. Using threads in conjunction with the BDE, Exceptions and DLLs.
Chapter 14. A real world problem, and its solution.


This guide is intended for anyone who is interested in improving performance and responsiveness in their Delphi applications by using threads. It covers a range of topics from absolute beginner to intermediate level, and some of the real world examples raise issues bordering on the advanced. It assumes that the reader has a reasonable knowledge of Object Pascal programming, including simple object orientation, and a working understanding of event based programming.

Recommended reading:

Title: Concurrent Systems: An integrated approach to Operating Systems, Database, and Distributed Systems.
Author: Jean Bacon.
Publisher: Addison-Wesley
ISBN: 0-201-41677-8

The author welcomes suggestions for other useful titles.

Navigation hints.

The narrative and diagrams in this guide are all contained in single HTML pages, one for each chapter. The source code examples appear in pop up windows. You will need a javascript enabled browser to view these. To facilitate viewing of the narrative and source in parallel, the reader may find it useful to tile the various web browser windows. This can be achieved by right clicking on the task bar, and selecting "Tile Windows Vertically".

© Martin Harvey 2000.