-----Original Message-----
From: Bob Friesenhahn [mailto:bfrie...@simple.dallas.tx.us] 
Sent: 18. december 2010 03:35

> In my experience, both Windows and POSIX provide thread specific data 
> ("TSD") APIs which are much more efficient than using mutexes for 
> doing things like accessing redundant caches without API 
> modifications.  The way this works is that your pointer is stored in a 
> thread-specific area so that it is found efficiently with one array 
> indexing operation.  TSD could be used to support the single-pixel 
> cache you mention.


Hi all.

The application I am working on just disables the cache. Locking is extremely
counterproductive, since we tile the image and put each thread to work in
parallel. I would think this is a very common way to operate, so I never
really understood the reason why locking was even an option.

In my opinion, TLD (thread local data) is over engineering and not
generally available. Why not just reserve a small buffer on the stack and
pass it to a thread-safe version of the conversion routine?

Something along these lines:

cmsTransformBuf buf;
cmsDoTransformTS(src, dst, pix_count, &buf);

The single-pixel would simply be put in the buffer.


Just my two cents, but it looks simple, portable, easy to use and solves
all problems I had with the current interface.


Kind regards,

Esben H-R Myosotis

------------------------------------------------------------------------------
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