Re: libjpeg thread safe constraint is not must
GLENN PEHRSON <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
I don't think we could arbitrarily declare that libjpeg is thread-safe. However, we could allow users to do that the same way they can declare that libpng is thread-safe, by setting a compiler flag, SETJMP_IS_THREAD_SAFE. (I am assuming that the only reason we have made libjpeg thread-unsafe is because it uses setjmp()). It wouldn't take much coding to put appropriate #ifdef SETJMP_IS_THREAD_SAFE tests in coders/jpeg.c; Bob, would you like me to attempt that? And do you remember other reasons libjpeg has been declared unsafe? Glenn > On July 28, 2017 at 6:42 AM yzh杨振宏 <[email protected]> wrote: > > > Hi,Bob, > > We find GraphicsMagick doesn't work well if the program self is multi thread. This is almost certainly because the JPEG coder has been marked as not thread safe. e.g., > > > > entry->thread_support=False; /* libjpeg is not thread safe */ > > > > We experiment by removing this constraint and see apparent performance improvement. > > > > Note that the thread safe assumption is not must for JPEG_LIB_VERSION >= 80 and LIBJPEG_TURBO_VERSION, and ImageMagick has remove the constraint since 6.8.9-8 in Sep 2014. See: > > https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=25495 > > > > Could GM remove this constraint in next release to benefit whole community, as many people will use GM in multi-thread scenario like us as an image http server. > > > > Best regards. > > zhyang > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ > Graphicsmagick-help mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Graphicsmagick-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help