RAD Studio |  |

Other Techniques for Sharing Memory
See Also
Collapse All

When using VCL objects, use the main thread to execute your code. Using the main thread ensures that the object does not indirectly access any memory that is also used by VCL objects in other threads. See Using the Main VCL Thread for more information on the main thread.

If the global memory does not need to be shared by multiple threads, consider using thread-local variables instead of global variables. By using thread-local variables, your thread does not need to wait for or lock out any other threads. See Using Thread-local Variables for more information about thread-local variables.

See Also

Locking Objects

Using the Main VCL Thread

Using Critical Sections

Using the Multi-read Exclusive-write Synchronizer

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