RAD Studio |  |

Avoiding Simultaneous Access
See Also
Collapse All

To avoid clashing with other threads when accessing global objects or variables, you may need to block the execution of other threads until your thread code has finished an operation. Be careful not to block other execution threads unnecessarily. Doing so can cause performance to degrade seriously and negate most of the advantages of using multiple threads.

Three techniques prevent other threads from accessing the same memory as your thread:

- Locking Objects
- Using Critical Sections
- Using a Multi-read Exclusive-write Synchronizer

See Also

Using the Main VCL Thread

Using Thread-local Variables

Waiting for Other Threads

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!