There have been a few posts about multi-threading on this list, but I'm
still a little fuzzy on best practices.  So let me rattle off a few
questions and factoids, then propose best practices to see if they sound
reasonable.

* My understanding is that if I don't want to enable pthreads or disable the
cache, I'll want redundant transforms for each worker thread.
* Bob Friesenhahn mentioned that having each worker thread create the
transforms it uses should improve performance on some platforms.
* To get thread-safety in creating transforms, I'll need to use
cmsCreateTransformTHR.
* Curiously, LCMS2 permanently associates a ContextID with a created
profile.  Should I infer from this that I should also create redundant
profiles for each thread?
* cmsDoTransform doesn't take in a ContextID.  If there's an error during
the transform, what gets reported to the callback?  The ContextID associated
with the transform?

In summary...
Best Practices:
1) Each worker thread creates its own profiles (?) using THR methods.
2) Each worker thread creates its own transforms using THR methods.
3) If I use a ContextID in the above methods that denotes the worker thread,
I should be able to identify the appropriate worker thread in the error
callback under just about any use case. (?)

Ideally, I'd prefer to avoid having a worker thread pool in my application,
but it seems like the best way to use LCMS today.

Thanks,
-Adam
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to