On Tue, 16 Dec 2008, Hal V. Engel wrote:
>
> What I do in my code is use this type of thing:
>
> #include <setjmp.h>
>
> jmp_buf cmsJumpBuffer;

This sort of approach does not work adequately/reliably for 
multi-threaded applications.  The whole setjmp mechanism is based on 
restoring a single CPU's stack so it becomes useless when multiple 
CPUs are involved in the same application.  And of course, as you say 
there can be problems with the C++ exception framework.

The best approach requires that the user provide some context (a 
pointer) to lcms and then lcms invokes the callback, passing the 
pointer it supplied.  This may still require some extra work in a 
multi-threaded application but it is usable.

Bob
======================================
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to