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

Andrea Canciani ranma42 at gmail.com
Thu Dec 16 09:37:56 PST 2010


On Thu, Dec 16, 2010 at 3:17 PM, Philippe Leroux <lerouxp at yahoo.ca> wrote:
>
>
> Hi!
>
> me again!
>
> i was thinking maybe with the pixman/simpleops version
> would it be possible to share one surface/context by many threads?

No, using the same surface as destination in multiple threads is not
supported and it probably won't ever be possible, because it's not
well-defined, in general.

>
> 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

It is and there are some ideas about making that actually happen in parallel,
but it requires some major changes in pixman and cairo, so it's
unlikely to happen
in the near future.

Additional details:
The idea in this case would be that you add graphical operations
sequentially (thus the sequence is ordered, well defined), just as usual, but
cairo and pixman actually perform them in parallel.
This would be a better use of your parallel processing power, because
it would still
guarantee that the result is the expected one, yet all the cores would
be used to
compute the image. Moreover it would also improve the performance of existing
applications ;)

Andrea


More information about the cairo mailing list