[cairo] Solid surface cache causing cross-thread unhappiness

Carlos Garcia Campos carlosgc at gnome.org
Wed Feb 28 10:57:32 PST 2007


El mié, 28-02-2007 a las 10:38 -0800, Carl Worth escribió:
> On Wed, 28 Feb 2007 13:31:50 -0500, Behdad Esfahbod wrote:
> > On Wed, 2007-02-28 at 12:13 -0500, Carl Worth wrote:
> > >
> > > I'm open for thoughts on the best approach to fix the problem.
> >
> > Weird that it happens.  We are locking around the cache, and return a
> > new reference, so cache evictions should not destroy (as in ref=0) any
> > pattern in use.
> 
> It doesn't have to be that it's hitting an in-use pattern.
> 
> It's probably just causing to threads to call into the same Display*
> and making Xlib all over.
> 
> Now, I think there's some locking that the application can turn on for
> Xlib (or through GDK) that could make this work. But a question is
> whether it's reasonable for a user to expect that using cairo's image
> backend in one thread could call into the Display* of xlib surfaces
> used only in separate threads.

Of course I know it's easy to fix by simply using gdk_threads_init and
GDK locks in evince, but this is not the question. In evince we have
decided not to use xlib from any thread than the main one and we trust
poppler is not going to use xlib surfaces but image surfaces as well as
any other backend, so we don't actually need to use GDK locks.

> -Carl
-- 
Carlos Garcia Campos
   elkalmail at yahoo.es
   carlosgc at gnome.org
   http://carlosgc.linups.org
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070228/322d7b2d/attachment.pgp


More information about the cairo mailing list