[cairo] Static caches and thread-safety

Leon Woestenberg leonw at mailcan.com
Fri Nov 12 05:53:19 PST 2004


Hello,

On Thu, 11 Nov 2004 22:09:20 -0500, "Carl Worth" <cworth at cworth.org>
said:
> On Thu, 11 Nov 2004 13:10:15 -0800, Bill Spitzak wrote:
> Keeping locking out of cairo definitely seems appealing. And I wouldn't
> guess that it would be common for less-informed users to want to make
> lots of simultaneous cairo_t objects. Stupid?
> 
> Thread-local storage?
> 
> Nothing seems perfectly clean here. Dirty, dirty...
>
Experience in developing a highly-portable TCP/IP stack (lwIP) that
works
also outside BSD/Unix/Linux environments: do not try to implement or
even
wrap around locking mechanisms.

I would strongly suggest instead of making the global (static) data
being
allocated on the caller's behalf, removing the thread-unsafety
altogether.

I am not sure what this would mean to the caller (maybe they cannot
share
font caches) but this is less of an issue.

Just my two cents,

Leon.



More information about the cairo mailing list