It's thread safe as long as you use a
separate TurboJPEG handle or jpeg_compress_struct instance and a
separate JPEG destination buffer for each thread. You cannot
simultaneously compress to the same JPEG destination buffer
using multiple threads. The handles/instances and buffers can
all be created in the main thread as long as the main thread
doesn't try to use them concurrently with any of the worker
threads. If you want more help than that, then you're going to
have to be more specific about the type of memory errors you're
getting, your compute environment, and exactly what your code is
trying to do.
From what I've read I was led to believe the entire library is thread safe, but when I try to compress more than one image at the same time (each in its own thread) I get random memory errors. Are there certain requirements, other than creating a compression handle for each thread? Is it ok to create these in the main thread, or do they need to created & destroyed in the thread itself (which would create overhead)? --
You received this message because you are subscribed to the Google Groups "libjpeg-turbo User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libjpeg-turbo-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/948e1ef9-b9af-4e2d-bbcb-f0bf2c65a5e2n%40googlegroups.com.
So am I. :|
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/93f5d038-ee85-49ed-a086-caa3e2b28d70n%40googlegroups.com.