FLIF-hub / FLIF

Free Lossless Image Format
Other
3.72k stars 229 forks source link

Multithreading restrictions for libflif_dec.so? #517

Open newpavlov opened 6 years ago

newpavlov commented 6 years ago

I am using libflif_dec.so in Rust through FFI. Code looks roughly like this. My code converts grayscale flif images to PNM with some processing. In single thread it works without problems, but when I use 3-4 threads to parallelize computations, for 1-2 first images in the queue FLIF decoder returns empty image (on some images it's zeroed pixels, on other equal to 15). Is there some multi-threading restrictions for libflif_dec.so or what else could cause this problem?

jonsneyers commented 6 years ago

There are still some global variables in the code, I think...

newpavlov commented 6 years ago

Is there a risk of more complex corruptions other than empty image?