Question about thread support

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
zhcn381
Posts: 17
Joined: 2012-07-05T02:34:18-07:00
Authentication code: 13

Question about thread support

Post by zhcn381 »

hi all,

Why process like GetImageEncoder() and GetImageDecoder() need to be mutex protected if no thread_support?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Question about thread support

Post by magick »

Assume a user program that reads multiple jpeg images, each in a different thread. The JPEG library does not support threading, so ImageMagick must ensure only one of these threads access the JPEG library at a time. Without the mutex, it is possible that multiple instances of the JPEG library will run in parallel causing an unknown run-time exception.
zhcn381
Posts: 17
Joined: 2012-07-05T02:34:18-07:00
Authentication code: 13

Re: Question about thread support

Post by zhcn381 »

thank you magick.
Post Reply