[vlc-devel] commit: Keep track of object held by threads ( Rémi Denis-Courmont )

Rémi Denis-Courmont rdenis at simphalempin.com
Sat May 31 23:30:20 CEST 2008


Le Sunday 01 June 2008 00:14:55 Pierre d'Herbemont, vous avez écrit :
> On May 31, 2008, at 10:54 PM, git version control wrote:
> > +    /* TODO: what if releasing without references? */
>
> Wouldn't that be a good idea to warn too here?

Sure. However it's a not completely straightforward as the "initial" reference 
is currently not tracked.

The thread variable destructor could also be used to detect reference leaks.

> Though, I am sure there could be some weird usage scheme where a
> first thread is holding the reference for a second one. But in this
> case we would have a warning from vlc_checkref anyway, so...

Yep. But it's all about semantics. If you decree that threads shall take of 
references themselves, so be it. I guess reference counting is equivalent to 
the halting problem, without strong additionnal constraints.

As an example, the finding potential deadlocks is equivalent to the halting 
problem. That's not prevented the Linux kernel from embedding its own locking 
consistency *proof*. It actually works because of human-made arbitrary extra 
constraints on how to and how not to lock.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list