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

Philippe Leroux lerouxp at yahoo.ca
Thu Dec 16 06:17:48 PST 2010



Hi!

me again!

i was thinking maybe with the pixman/simpleops version
would it be possible to share one surface/context by many threads?

because, i've tried it, for some other types of visualization output
and i get the same kind of error

just curious, i know this that i am now trying to do is rather radioactive (i 
have different iteration in a simulation each of which adds some strokes with an 
alpha value, doesnt matter how nor when they get applied, i just try to get a 
sort of cumulative output, and different threads handles different iterations)
maybe this is still too crazy for cairo, and  then maybe it can help improve 
cairo/multithread
after-all multi-threading is the future for performance

sincerely

Philippe



----- Message initial ----
De : Andrea Canciani <ranma42 at gmail.com>
À : Philippe Leroux <lerouxp at yahoo.ca>
Cc : cairo <cairo at cairographics.org>
Envoyé le : Mer 15 décembre 2010, 18h 09min 20s
Objet : Re: Re : Re : Re : [cairo] Re : multithreaded bug in cairo on call to 
cairo stroke?

On Wed, Dec 15, 2010 at 4:27 PM, Philippe Leroux <lerouxp at yahoo.ca> wrote:
>
>
> ya pixman/simpleops is fine for me now
>
> out of curiosity
>
> so if i change the source to a random pattern just after i created the context
> (in each threads)
> would that force cairo to use a seperate source for each thread? and be kind 
of
> a workaround?
> because, i tried and it doesnt seems to work

It's slightly harder than that, because cairo is clever enough to
notice if you are
actually using the same pattern.
For example, if you create a solid color using a gradients whose color stops
all have the same color, cairo will usually optimize it to a solid color.
To actually force disctinct sources you would probably have to use surface
patterns, but I think this would cause major slowdowns.

>
> i also tested your second patch (and without pixman/simplops)
> works fine, with colors !

Very good. We don't have a clean fix yet, but at least we know how
it can be fixed.

Andrea





More information about the cairo mailing list