Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-26 Thread Ronald S. Bultje
Hi, On Fri, Feb 26, 2016 at 5:30 AM, wm4 wrote: > I don't know about this case, but the frame threading code uses > improper double-checked logging. Basically it doesn't use proper > barrier or atomics, assumes x86 semantics, and hopes the compiler won't > get into the way. In that case, it sh

Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-26 Thread Michael Niedermayer
On Thu, Feb 25, 2016 at 08:59:39PM -0800, Wan-Teh Chang wrote: > On Thu, Feb 25, 2016 at 8:14 PM, Michael Niedermayer > wrote: > > > > also considering this is performance relevant code, please provide > > a benchmark > > I'll be happy to provide a benchmark. I don't see the instructions for > ru

Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-26 Thread wm4
On Fri, 26 Feb 2016 05:14:47 +0100 Michael Niedermayer wrote: > On Thu, Feb 25, 2016 at 04:42:22PM -0800, Wan-Teh Chang wrote: > > On Thu, Feb 25, 2016 at 4:15 PM, Hendrik Leppkes > > wrote: > > > > > > Similar to the other patch, please explain what this actually fixes, > > > those sanitizer

Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-25 Thread Wan-Teh Chang
On Thu, Feb 25, 2016 at 8:14 PM, Michael Niedermayer wrote: > > also considering this is performance relevant code, please provide > a benchmark I'll be happy to provide a benchmark. I don't see the instructions for running benchmarks in the patch submission checklist: https://ffmpeg.org/develope

Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-25 Thread Michael Niedermayer
On Thu, Feb 25, 2016 at 04:42:22PM -0800, Wan-Teh Chang wrote: > On Thu, Feb 25, 2016 at 4:15 PM, Hendrik Leppkes wrote: > > > > Similar to the other patch, please explain what this actually fixes, > > those sanitizer tools produce a lot of false positives and nonsensical > > warnings. > > Yes, c

Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-25 Thread Wan-Teh Chang
On Thu, Feb 25, 2016 at 4:15 PM, Hendrik Leppkes wrote: > > Similar to the other patch, please explain what this actually fixes, > those sanitizer tools produce a lot of false positives and nonsensical > warnings. Yes, certainly. In libavcodec/pthread_frame.c, we have: 46 /** 47 * Context us

Re: [FFmpeg-devel] [PATCH] Always read frame progress values under progress_mutex.

2016-02-25 Thread Hendrik Leppkes
On Fri, Feb 26, 2016 at 1:06 AM, Wan-Teh Chang wrote: > This fixes data race warnings by ThreadSanitizer. > ff_thread_report_progress and ff_thread_await_progress should read > progress[field] only when holding progress_mutex because progress_mutex > guards frame progress values. Similar to the o