we're developing a network app using the Magick++ interface that reads several *.jpg images from disk from multiple separate threads. Even though ImageMagick has been compiled statically with multi-threading support on Win32, we notice when we step through the code that threading is being disabled for JPEGs (libjpeg), so the images are being read from disk in a non-threaded fashion. Is this intentional, or should libjpeg be thread-safe?
perusing the ImageMagick site docs, it seems that the claim is made that ImageMagick is thread-safe with the exception of a few select pixel cache related functions, which we don't use in our code..
Is ImageMagick thread-safe for libjpeg, or is multi-threading disabled because of thread-safety issues with libjpeg?
multi-threading with libjpeg
Re: multi-threading with libjpeg
ImageMagick is thread safe, the JPEG delegate library is not. You can enable thread support by editing coders/jpeg.c and changing the thread support member to this:
- entry->thread_support=DecoderThreadSupport | EncoderThreadSupport;
Re: multi-threading with libjpeg
thanks for the info.
if the delegate library, libjpeg, is not thread-safe, then i'd rather not enable threading, overriding the defaults, if the results will be unstable.
is there an alternative delegate library for the jpeg coder, or is no multi-threading support simply a fact of life when dealing with JPEGs and ImageMagick?
if the delegate library, libjpeg, is not thread-safe, then i'd rather not enable threading, overriding the defaults, if the results will be unstable.
is there an alternative delegate library for the jpeg coder, or is no multi-threading support simply a fact of life when dealing with JPEGs and ImageMagick?