[cairo] Solid surface cache causing cross-thread unhappiness

MenTaLguY mental at rydia.net
Wed Feb 28 11:13:48 PST 2007


On Wed, 28 Feb 2007 10:39:28 -0800, Carl Worth <cworth at cworth.org> wrote:
> On Wed, 28 Feb 2007 10:18:36 -0800, MenTaLguY wrote:
>> To clarify, is this an issue of the ejected surface being destroyed
>> while another thread is using it to draw with, or an issue of xlib
>> calls from surface destruction conflicting with (non-cairo?) xlib
>> calls made from another thread?
> 
> I don't know which case the application in question hit, but I think
> either case would manifest similarly. As far as I understand the error
> message, it's two threads calling into the same Display* when Xlib
> wasn't prepared for that.

So, really the latter then...

Have you considered making the solid surface cache per-thread?  Even with a workaround in place for this particular issue, you are likely to encounter similar issues with other backends in the future.  Giving each thread its own private cache will eliminate this class of issues with respect to cache eviction, and should also reduce synchronization overhead somewhat.

-mental



More information about the cairo mailing list