[cairo] Static caches and thread-safety

Bill Spitzak spitzak at d2.com
Fri Nov 12 10:57:32 PST 2004


On Friday 12 November 2004 08:20 am, Owen Taylor wrote:
> Traditionally on Linux, using threads required linking to
>    -lpthread, and linking to -lpthread can slow apps down
>    5-10%. (More if you use getc() a lot.)

IMHO this was a serious blunder by the pthreads standard.

FILE objects should have *not* been made thread-safe. Much like cairo_t 
objects (and objects in many other libraries), using two *different* FILE 
objects should have been thread-safe, but not using the same one.

Vast numbers of programs that assumme getc() is fast were hurt badly by this 
decision. Probably impossible for them to fix it, though. Sigh.



More information about the cairo mailing list