ADC Home > Reference Library > Technical Q&As > Graphics & Imaging > ColorSync >

Is ColorSync thread safe?


Q: On Mac OS X, can I call ColorSync from multiple threads, or is this ultimately dependent upon the particular color management module (CMM) I'm using? For example, if I have a number of images to color match can I have each image color matched in a different thread? The color world for each match may be the same (the same input, pass-through and output profiles) but each image being color matched would be unique.

A: ColorSync thread safeness is dependent upon the CMM you are using.

If you are using the Apple CMM, it's OK to use ColorSync functions which access a color world reference (CMWorldRef ) or profile reference (CMProfileRef ), such as CWMatchPixMap , CWMatchBitmap , and so on, from multiple threads. However, modifying a CMProfileRef from multiple threads is not guaranteed to work correctly.

Also, if your goal is faster ColorSync matching, there's really no point starting multiple threads to handle multiple images if you're using the Apple CMM, because the Apple CMM already divides the work between multiple threads (one per processor) internally on both Mac OS 9 and Mac OS X.


[Apr 17, 2003]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.