<br><div class="gmail_quote">On Tue, Jul 26, 2011 at 6:40 PM, Shaun Simpson <span dir="ltr"><<a href="mailto:shaun.simpson@crsltd.com">shaun.simpson@crsltd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Looking around I have read that the C equivalent Jpeglib is not thread safe. <u></u><u></u></p>
<p class="MsoNormal">I believe that the Pascal code is derived from the C.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Is the Free Pascal implementation of Jpeglib is thread safe?<u></u><u></u></p>
<p class="MsoNormal">I am using a class similar to FPReadJPEG and FPWriteJPEG from multiple threads, do I need some form of locking?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><br></div></div></blockquote></div>
<br><br>It's an interesting question. Seems like the places that mention thread non-safety, mean something different, for example<br><br>From <a href="http://www.freedesktop.org/wiki/Software/libjpeg">http://www.freedesktop.org/wiki/Software/libjpeg</a><br>
(Note: the JPEG <span class="anchor" id="line-1884"></span>library currently is not thread-safe. You must not call jpeg_consume_input() <span class="anchor" id="line-1885"></span>from one thread of control if a different library routine is working on the <span class="anchor" id="line-1886"></span>same JPEG object in another thread.) <br>
<br>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<br><br>Max Vlasov <br>