rillian/tiff2png

Multithreading this program

Opened this issue · 1 comments

Is this program thread-safe?
This is a very nice utility you have. I will give it a try.
I am planning to use it in a system which may need conversions on the fly to render on the browser.
There may be million transactions occurring in an hour and it needs to be thread safe because this will be wrapped in JNI calls.

Hmm. I hadn't looked at this. It's mostly thread-safe I think, with everything descending from the entry point with local variables. I believe the underlying tiff, jpeg, png and z libraries are also thread-safe.

The problem is the error handling, which goes through the tiff2png_jmpbuf_struct global. You'd have to move that to a per-thread variable and pass it into tiff2png() instead.