Hi, I have a big interest in running cmsDoTransform() in multiple threads using the same transform:
From: Bob Friesenhahn [mailto:bfrie...@simple.dallas.tx.us] Sent: 22. februar 2010 18:52 > Certainly there may be advantages if the transform may be shared > between threads without locking, and there are very clear advantages > if the transforms may be simultaneously generated by multiple threads, > or if a transform may be cloned by a thread (into fast local > memory) for its use. Marti had the following input: From: marti.ma...@littlecms.com [mailto:marti.ma...@littlecms.com] Sent: 26. februar 2010 10:49 > The idea on lcms-2 is a cmsDoTransform() is re-entrant and same > transform can be shared between threads. The locking happens only > if 1-pixel caché is being used, and in this case once per > cmsDoTransform() call. > > So, you could try to inhibit caché (there is a flag to do so) or > process large chunks of data in each cmsDoTransform(). Probably > there is a room for improvement, but the basis are already in the code. So I tried this out and disabling the pixel cache seems to work well. Unfortunately it does not work for CMYK-profiles. I _think_ this is because Eval4Inputs() does the following: ((cmsInterpParams*) p16) -> nInputs = 3; // I promise to restore the value... ... [ Some other thread get 3 ] ... ((cmsInterpParams*) p16) -> nInputs = 4; // As promised. I did not check, but I think this also implies that locking is required for CMYK. It feels so close :-( Regards, Esben Høgh-Rasmussen Myosotis Software Engineer ------------------------------------------------------------------------------ _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user