[fpc-pascal] Jpeglib thread safe?

Max Vlasov max.vlasov at gmail.com
Tue Jul 26 20:37:26 CEST 2011


On Tue, Jul 26, 2011 at 6:40 PM, Shaun Simpson <shaun.simpson at crsltd.com>wrote:

> 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

>From http://www.freedesktop.org/wiki/Software/libjpeg
(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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110726/779099c0/attachment.html>


More information about the fpc-pascal mailing list