ImageGear and its associated components are completely thread-safe. The implementation of thread safety in ImageGear maximizes the performance of threaded applications on multi-CPU computers. Every ImageGear API function can be executed within a thread.
Five thread safety APIs are explained in detail in the Core Component API Function Reference.
- IG_thread_data_ID_associate() provides thread customized ImageGear settings.
- IG_thread_data_ID_get() provides thread customized ImageGear settings.
- IG_thread_local_data_cleanup() provides thread customized ImageGear settings.
- IG_thread_image_lock() is required in the situation where several threads are accessing the same HIGEAR concurrently AND at least one of these threads performs an operation that modifies/deletes HIGEAR.
- IG_thread_image_unlock() is required in the situation where several threads are accessing the same HIGEAR concurrently AND at least one of these threads performs an operation that modifies/deletes HIGEAR.
In most cases, no additional API calls are required to achieve thread safety.
The global group of ART settings cannot be used in multi-threaded application. You have to use this function to associate a new local group of settings for each new thread. For more detailed information, see the example code for IG_thread_data_ID_associate(). |