RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.NeverSleepOnMMThreadContention Variable

Dictates memory manager behavior during a thread contention.

Pascal
NeverSleepOnMMThreadContention: Boolean;
C++
Boolean NeverSleepOnMMThreadContention;

The Memory Manager is a shared resource, and when many threads in the application attempt to perform a memory operation at the same time, one or more threads may have to wait for a pending operation in another thread to complete before it can continue. This situation is called a thread contention. When a thread contention occurs inside the Memory Manager the default behavior is to first relinquish the remaining time in the thread’s time slice. If the resource is still not available when the thread enters its next time slice, the Memory Manager calls the OS procedure Sleep before trying again.  

This behavior works well on machines with single or dual core CPUs, and also when the ratio of the number of running threads to number of CPU cores is relatively high (greater than 2:1). In other situations, better performance can be obtained by entering a busy waiting loop until the resource becomes available. If NeverSleepOnMMThreadContention is True, the Memory Manager will use this alternate strategy when a thread contention occurs. The default value for NeverSleepOnMMThreadContention is False

 

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