[cairo] Re : multithreaded bug in cairo on call to cairo stroke?

Andrea Canciani ranma42 at gmail.com
Wed Dec 15 01:44:15 PST 2010

On Wed, Dec 15, 2010 at 10:31 AM, Philippe Leroux <lerouxp at yahoo.ca> wrote:
> Hi cairo-community,
>  i didnt get any answers yet
> i tried with the golang community (www.golang.org)
> and i have made sure that my functions drawing to their own surface/context are
> executed on different OS threads
> and not multiplexed on one thread
> i still get the corruption, double free  error
> so i guess this is a multithread issue inside cairo
> can anyone help me out debug that one?

Currently pixman requires that the same image is only used
in one thread at a time. Cairo, instead, assumes that an image
can be used as source in multiple threads.

Adding atomic refcounting to pixman images would likely
solve this issue.
In http://lists.cairographics.org/archives/pixman/2010-October/000644.html
you can find a link to one of my pixman branches that add atomic refcounting.

If recompiling pixman is not an option, now I'm afraid that the only way to have
a threadsafe app is not use cairo concurrently.

I should probably also mention that there are other independent threadsafety
issues in cairo vector backends, but they are likely unrelated to your problem.


More information about the cairo mailing list