Managing Multiple Threads

As indicated earlier, although threads can solve a variety of programming problems, they're also likely to introduce new types of problems that you must deal with in your applications. Most commonly, these problems revolve around multiple threads accessing global resources, such as global variables or handles. Additionally, problems can arise when you need to ensure that some event in one thread always occurs before or after some other event in another thread. In this section, you learn how to tackle these problems by using the facilities provided by Delphi for thread-local storage and those provided by the API for thread synchronization.

Thread-Local Storage

Because each thread represents a separate and distinct path ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.