2006.09.22 14:20 "[Tiff] libjpeg", by Philip Watkinson

2006.09.22 15:20 "Re: [Tiff] libjpeg", by Joris Van Damme

Philip,

Is libjpeg thread safe?

I believe it is. Of course, 'thread safe' is a misleading classification, in that it seems to indicate calling threads can do anything they please. They can't, in that things do need to be logically consistent. For example, if you're spreading a single decoding or encoding session over multiple threads, you'll need synchronisation external to the LibJpeg library, either by logical design or by locks.

The same also applies to LibTiff. You can call LibTiff from within any thread, and any two threads can use LibTiff simultaniously as long as it makes sense. Just don't do logically inconsistent stuff like using TIFFReadDirectory in one thread and potentially simultaniously using TIFFGetField on the same TIFF* in another thread.

Best regards,

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html