From: <ma...@li...> - 2002-03-05 09:17:34
|
Hi, I'm forwarding this to mailing list... could be interesting for someone else. > I have been looking through some of the LCMS code and it seems like it is > not > thread-safe. In particular I looked at > > cmsTakeProductName > cmsTakeProductDesc > cmsTakeProductInfo > > all of which have static chars defined that could cause threading issues. > Is there a particular reason why these are set as statics? What would > happen if I would just change that. Yes, you are right. Those functions are NOT thread safe, since they write to a static buffer. However, those functions are ment to be used on UI only. The transform code is thread safe with USE_C method. I did check on a multiprocessor machine and did work. And you can change them if wish so... I used the static buffer just for simplicity sake. Nothing prevents to use a buffer pointer as a parameter, for example. But please note that those functions would be very rarely used on separated threads. About the "nDoAbort". This is supposed to be a global setting. Probably a multithreaded application would replace whole error handling by its own. Is as easy as write repacements for cmsSignalError() and cmsErrorAction(). Regards, Martí Maria The little cms project http://www.littlecms.com ma...@li... ----- Original Message ----- From: "Dhiraj Kacker" <dk...@sh...> To: "'Martí Maria'" <ma...@li...> Sent: Tuesday, March 05, 2002 12:09 AM Subject: is LCMS thread safe? > Hi Marti, > > I have been looking through some of the LCMS code and it seems like it is > not > thread-safe. In particular I looked at > > cmsTakeProductName > cmsTakeProductDesc > cmsTakeProductInfo > > all of which have static chars defined that could cause threading issues. > Is there a particular reason why these are set as statics? What would > happen if I would just change that. > > Also in the error handling the gloabal variable "nDoAbort" is used making > that too risky to use with multiple threads. > > Thoughts? > > -Dhiraj > > |