Using multiple threads allows your application to fully utilize the available computational power. Typically the optimum performance is achieved when number of concurrent threads using ClearImage is limited to twice the number of CPU cores (or hyper-threaded cores, if applicable)
C#
This example shows processing multiple files using multiple threads (.NET 4.0 and higher).
This example demonstrates the use of the FileSystemWatcher to monitor the input folder and process image files.
VB
1234567891011
Private Sub ProcessFilesThreaded(fileNames As String()) Try Dim parallelOptions As New ParallelOptions() parallelOptions.MaxDegreeOfParallelism = Environment.ProcessorCount * 2 Parallel.ForEach(fileNames, parallelOptions, Sub(fileName) ProcessFile(fileName) End Sub) Catch ex As Exception ProcessException(ex) End TryEnd Sub
This example demonstrates the use of the FileSystemWatcher to monitor the input folder and process image files.
Java
This example demonstrates the processing of image files from a single folder using the anonymous thread method.