[FFmpeg-devel] [PATCH] Move the |die| member of FrameThreadContext to PerThreadContext.

Ronald S. Bultje rsbultje at gmail.com
Fri Feb 26 21:14:05 CET 2016


Hi,

On Thu, Feb 25, 2016 at 8:26 PM, Wan-Teh Chang <wtc-at-google.com at ffmpeg.org
> wrote:

> On Thu, Feb 25, 2016 at 12:00 PM, Ronald S. Bultje <rsbultje at gmail.com>
> wrote:

> If anything, you can use atomic ints instead of regular ints if we don't
>
> already [1].
> >
> [...]
> > [1] https://ffmpeg.org/doxygen/trunk/atomic_8h_source.html
>
> Thanks for the link. avpriv_atomic_int_get and avpriv_atomic_int_set
> perform the load and store with sequential consistency, which requires
> a full memory barrier and is slower than simply relying on the
> existing per-thread mutex. The drawback of my patch is that it uses
> more memory. I think that's the right trade-off, but I would be happy
> to use an atomic int. Please let me know what you prefer.


Is probably OK since it doesn't introduce new lock/unlock pairs, yes. We
typically don't care about a few bytes of memory.

Ronald


More information about the ffmpeg-devel mailing list