[cairo] [PATCH] Do not hold mutexes when calling destructors.
jeff at infidigm.net
Thu May 15 13:17:07 PDT 2008
On Thu, May 15, 2008 at 03:51:05PM -0400, Behdad Esfahbod wrote:
> On Thu, 2008-05-15 at 15:50 -0400, Jeff Muizelaar wrote:
> > That's a more interesting concern. In practice everything should be
> > fine
> > as we don't hold any special state across the lock release. I.e. if an
> > entry we'll added to the cache we'll just remove it in the next loop
> > iteration and if an entry was removed that's fine to. However, in
> > theory everytime we released the lock a new cache entry could be added
> > and the loop would never terminate. I agree that this property isn't
> > really useful and can redo the patch to use a copy if this situation
> > matters enough.
> If you don't lock, you don't have any memory barriers. You may try to
> remove a pointer from the cache without having the memory it points to
> visible in your view of the memory. Something like that. I'm sure
> there are architectures that this scheme is broken on.
You've lost me. Both implementations (mine and krh's) lock when ever
they modify the cache...
More information about the cairo