Hi,<br><br><div class="gmail_quote">2009/12/28 Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:rem@videolan.org">rem@videolan.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Le lundi 28 décembre 2009, Srikanth Raju a écrit :<br>
<div class="im">> Hello,<br>
> I've attached new patches. I've split up the patch into two pieces.<br>
> The first is just the vlc_media_library.h header file. The second<br>
> includes the core.<br>
><br>
> Things that need looking into:<br>
> * The general API in the header file. Most of the functions are<br>
> simple helpers, so it's not really important to look at the<br>
> implementation in too much detail. What I'm looking for is a holistic<br>
> review.<br>
<br>
</div>Don't add new typedefs to vlc_common.h. This is historical.<br>
<br>
Also don't define identifiers with leading underscores.<br>
The C standard reserves those for the run-time.<br>
<br>
And don't cut&paste the atomic reference counting code. If you really<br>
need to invent your own, then factor it out. But I really don't<br>
understand why you need this.<br>
<div class="im"><br></div></blockquote><div><br></div><div>Here's a quick explanation.</div><div>There is a media "pool" that contains all the media objects that are currently in existence. This is to ensure only one media object exists for a given id. This also acts as a cache for these medias. There is a garbage collecting loop that runs on this pool. When the ref count of an object becomes 1, it waits n seconds before calling the destructor of this object.</div>
<div><br></div><div>Thus, ml_gc_incref is the same as vlc_gc_incref. And ml_gc_decref should fail in the case when the media exists in the pool, but its refs has become 0 by a call to the same function. Because it will be the job of the GC loop to clean up the last ref held by the pool.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
> * ml_gc_incref and ml_gc_decref. These rely on a garbage collecting<br>
> loop in the module that tests if refs = 1 and then releases the<br>
> object if so. Is testing the refs "ok" by anything other than the<br>
> vlc_gc functions?<br>
<br>
</div>That won't work as the test and release is not an atomic operation.<br>
<div class="im"><br></div></blockquote><div><br></div><div>So, if this is implemented as an atomic operation ( similar to vlc_release ), it will be fine. Correct?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
--<br>
Rémi Denis-Courmont<br>
<a href="http://www.remlab.net/" target="_blank">http://www.remlab.net/</a><br>
</div><div><div></div><div class="h5">_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Srikanth Raju<br>