←Select platform

MaximumThreadCount Property

Summary
Gets or sets the maximum number of threads used during processing.
Syntax
C#
C++/CLI
Python
public static int MaximumThreadCount { get; set; } 
public: 
static property int MaximumThreadCount { 
   int get(); 
   void set (    int ); 
} 
MaximumThreadCount # get and set (RasterDefaults) 

Property Value

An Int32 value that represents the maximum number of threads used during processing. Must be a value greater than or equals to 0. Default value is the number of CPUs/Cores in the current machine (System.Environment.ProcessorCount).

Remarks

Currently only the LEADTOOLS JPEG2000 Encoder and Decoder are using this property. More LEADTOOLS encoders/decoders may use this property in the future.

Using two threads with a dual core machine or two CPUs will increase the processing speed significantly if the processing supports parallel processing.

Possible values are:

ValueDescription
0

The toolkit will pick the proper number of running threads based on the number of CPUs/Cores of the current machines. Note: the toolkit will calculate this value internally and set it. Getting the value of this property will never return 0.

1Use one thread only. In this case, the toolkit will not create extra threads for the processing, instead, all operations will be performed in the main thread.
2Use two threads. The toolkit will create a maximum of two threads for processing if needed.
NUse N threads. The toolkit will create a maximum of N threads for processing if needed.

Values less than zero will be rejected. Large values, more than the number of CPU/Cores, will not increase performance and might cause resource usage overload which could lead to processing failure.

The MaximumThreadCount property is a global resource used by all LEADTOOLS and is not thread-safe. Make sure to use property thread synchronization if required.

Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.