Menu

#318 Global lock in png.c downgrade multithreads performance

v1.0_(example)
closed-fixed
None
5
2018-04-28
2015-09-22
Yuhan Guo
No

We are using GraphicsMagick-1.3.21 version to do image processing. We found our program not picking up CPU usage even when load is high, and requests just keep piling up.

We noticed that there is a png_semaphore in coders/png.c. And it serializes ReadOnePNGImage and WriteOnePNGImage calls in our multithreading environment. Which basically becomes the bottleneck of our program.

I noticed that this lock is just for setjmp/longjmp to handle exceptions, and these calls are tricky and not necessarily thread-safe. Is there a way to get around with that?

Thank you in advance!

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2018-04-28
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2018-04-28

    This issue was fixed in the 1.3.27 release:

    • JPEG/PNG: The SETJMP_IS_THREAD_SAFE definition is used to determine
      if setjmp/longjmp are thread safe. If these interfaces are thread
      safe, then concurrent reads/writes are possible. This definition is
      false for Solaris but true for Linux. JPEG and PNG will be fully
      concurrent if this definition is enabled.
     

Log in to post a comment.

MongoDB Logo MongoDB