ThumbnailXpress 6 for .NET - User Guide > How To > Set Threading Behavior |
ThumbnailXpress™ uses background image generation threads to improve responsiveness. At component start-up, ThumbnailXpress determines an initial count of background threads based on the host computer's capabilities. To keep operation responsive, ThumbnailXpress monitors the time consumed by a background thread and will start an additional thread when it has determined that a particular thread's image retrieval/generation time has exceeded the user settable ThreadStartThreshold property value.
By default, the value of this property is 3000 milliseconds (3 seconds). Additionally, ThumbnailXpress will abandon a thread, and free up its resources, if its retrieval/generation time has exceeded the ThreadHungThreshold property value. By default, the value of this property is 9000 milliseconds (9 seconds). As noted, when needed, ThumbnailXpress will create additional threads but will not allow the count of concurrent background threads to exceed the value specified by the MaximumThreadCount property.
The default value for the MaximumThreadCount property is 2 times the calculated initial count of background threads. The allowable value range for this property is 1 thru 32. Too many background threads quickly degrade performance and a good rule of thumb for all these threading properties is to leave them at the default values. For applications that don’t want an image loading attempt to be abandoned and want to allow, for example, the potential of very slow internet access for retrieving images, set the ThreadHungThreshold property to a higher value.
It's important not to run one instance of the control from multiple application threads, instead, create a separate instance of the control for each application thread. For a well-presented primer on threading, see Microsoft's "What Every Dev Must Know About Multithreaded Apps" at the Visual Studio.NET Developer Center (08/05, http://msdn.microsoft.com/en-us/magazine/cc163744.aspx).
The Performance tab in the Microsoft Windows Task Manager dialog box (press CTRL, ALT and Delete keys) displays multiple CPU Usage History boxes for both logical and physical CPUs. The image below shows a single CPU with two logical CPU's.