[cairo] Multi-threaded surface drawing?

KwangYul Seo kwangyul.seo at gmail.com
Sat May 24 23:29:14 PDT 2008


Hi,

I asked the same question here, but got no response. I tested drawing to the
same surface by multiple threads. I used ImageSurface and the result was
promising. I could reduce the total drawing time by factor of almost 2 in my
dual core processor.

When you have multiple threads with their own cairo context, you can do
high-level graphics operations such as tessellation in parallel, so you can
get performance boost regardless of the underlying surface. However, I am
not sure this approach is thread-safe across various cairo back-ends.

What is the plan to optimize cairo with the advent of multi-core processors?
Creating multiple cairo contexts with multiple threads to the same surface
is the right approach?

Regards,
Kwang Yul Seo


On Tue, May 20, 2008 at 8:40 AM, Augusto Radtke <radtke at radtke.com.br>
wrote:

> Hello! I couldn't found this answer in the usual places, so maybe someone
> here can. It's possible to draw to the same surface by multiple threads? I
> mean creating two contexts, one with each thread and clip it to different
> regions of the surface and draw in parallel?
>
> The idea is to reduce the total drawing time but I feel this feature could
> be backend-specific and for some backend won't be really useful at all. Am I
> right?
>
> Thank you,
>
> Augusto
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080525/6f2ca40c/attachment.html 


More information about the cairo mailing list