[vlc-devel] [PATCH v2 01/10] core: add atomic refcounter helper
rom1v at videolabs.io
Mon Jul 2 18:55:12 CEST 2018
On Mon, Jul 02, 2018 at 06:56:57PM +0300, Rémi Denis-Courmont wrote:
> I prefer thread fence over release order but I still don't know any way to make a helper without removing asserts, and I don't want to remove asserts.
0. we remove these refcount asserts (you don't want that);
1. we keep assert() in the header (like in other existing headers);
2. we move the implementation to a .c and keep the asserts there;
3. we implement the function as macro, so the clients need to include
assert.h themselves (thx robux4).
My personal choice is 1.
Anyway, requiring every classical refcount user to manage the memory
order details themselves, the way you did yesterday (1), is not ok for
me. We could have discussed it if you did not push that commit without
> Le 2 juillet 2018 18:46:58 GMT+03:00, Romain Vimont <rom1v at videolabs.io> a écrit :
> >On Mon, Jul 02, 2018 at 06:32:33PM +0300, Rémi Denis-Courmont wrote:
> >> Scratch picture_t, but still read-only objects (e.g. QString backend
> >storage) or read-only accesses don't need release barrier.
> >> Also acquire barrier is not needed when reference count is more than
> >I'm glad you watched the video linked in the commit message more than 3
> >minutes (1), so that you were able to apply what the author explained
> >some random file in VLC yesterday (2).
> >However, I think it would benefit the project more if this was done in
> >a helper used many times.
> >If you prefer to use the second version (with the explicit fence), we
> >can just change the implementation of vlc_atomic_rc_dec().
> >vlc-devel mailing list
> >To unsubscribe or modify your subscription options:
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel