Using threads to process multiple image files

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

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.

Java

This example demonstrates the processing of image files from a single folder using the anonymous thread method.

ClearImage 7 multi-threading

ClearImage 7 support has the following limitations:

  • ClearImage 7 COM API does NOT directly support multi-threaded processing. If needed, use multiple processes, each using ClearImage 7 on a single thread.
  • ClearImage 7 .NET API supports multi-threading, but number of concurrently running threads utilizing ClearImage should be limited to computer core count.

Creating a new, separate thread to process each single file is very inefficient. Threads should be configured to persist and process many files.