Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-07

Jpeglib thread safe?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shaun Simpson

Hi,

Looking around I have read that the C equivalent Jpeglib is not thread safe.

I believe that the Pascal code is derived from the C.

Is the Free Pascal implementation of Jpeglib is thread safe?

I am using a class similar to FPReadJPEG and FPWriteJPEG from multiple threads, do I need some form of locking?

Thank you,

Shaun

Max Vlasov
to Shaun Simpson
Shaun Simpson wrote 19 lines
Hi,**** ** ** Looking around I have read that the C equivalent Jpeglib is not thread safe. **** I believe that the Pascal code is derived from the C.**** ** ** Is the Free Pascal implementation of Jpeglib is thread safe?**** I am using a class similar to FPReadJPEG and FPWriteJPEG from multiple threads, do I need some form of locking?**** ** **

It's an interesting question. Seems like the places that mention thread non-safety, mean something different, for example

(Note: the JPEG library currently is not thread-safe. You must not call jpeg_consume_input() from one thread of control if a different library routine is working on the same JPEG object in another thread.)

So I suppose when you're talking about different jpeg files, there should be no problem, at least I'm not aware of IJG code to be using global variables that can be a real tread in this case

Max Vlasov