[cairo] Multithreading questions

cu cairouser at yahoo.com
Wed Jul 7 10:37:00 PDT 2010

I am using cairo in a slightly multithreaded application. From my
experience, if you do not draw to the same surface from multiple threads
at one time - you will be ok.

If you use the same surface as a source for patterns that will be used
in different threads, it may work unless you need to rotate a pattern.
I.e. "read only" shared use is not always without issues.

Any use of font output seems to break badly when used from multiple
threads, so if you must output text, make sure to serialize.

I am a cairo user, not a developer - so YMMV.

Thomas Dempton wrote:
> Hi,
> I would like to use cairo's image backend in a highly scalable
> multi-threaded server-application.
> I searched arround for documentation regarding threading, but found
> not really answers to my questions:
> - How scalable is Cairo? When is lockning done on which data?
> - How do I have to take care of what? May I pass surfaces from one
> thread to another?
> Do I have to do some locking by my own?
> - Does cairo use per-thread or static datastructures, which need to be
> taken special care?
> Thanks you, Thomas
> ------------------------------------------------------------------------
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list