Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multithreading this program #1

Open
yarafatin opened this issue Aug 14, 2015 · 1 comment
Open

Multithreading this program #1

yarafatin opened this issue Aug 14, 2015 · 1 comment

Comments

@yarafatin
Copy link

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.

@rillian
Copy link
Owner

rillian commented Aug 28, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants