[MPlayer-dev-eng] threaded cache

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Nov 27 16:35:12 CET 2011


On Sun, Nov 27, 2011 at 04:31:29PM +0100, Reimar Döffinger wrote:
> On Sat, Nov 26, 2011 at 07:41:00PM +0100, Dan Oscarsson wrote:
> > @@ -398,9 +421,18 @@
> >  #endif
> >              if (sleep_count < INITIAL_FILL_USLEEP_COUNT) {
> >                  sleep_count++;
> > -                usec_sleep(INITIAL_FILL_USLEEP_TIME);
> > +                sleep_time = INITIAL_FILL_USLEEP_TIME;
> >              } else
> > -                usec_sleep(FILL_USLEEP_TIME); // idle
> > +                sleep_time = FILL_USLEEP_TIME; // idle
> > +#if defined(PTHREAD_CACHE)
> > +            pthread_mutex_lock(&s->go_ahead_mutex);
> > +            clock_gettime(CLOCK_REALTIME, &ts);
> > +            ts.tv_nsec += sleep_time*1000;
> > +            pthread_cond_timedwait(&s->go_ahead, &s->go_ahead_mutex, &ts);
> > +            pthread_mutex_unlock(&s->go_ahead_mutex);
> > +#else
> > +            usec_sleep(sleep_time);
> > +#endif
> 
> I'd expect that the latency for command-handling is more relevant than
> here - under normal operation we should never get into this loop (ok,
> except for seeking, but there it should never really matter among other
> delays).
> The problem is that the critical wait is "hidden" inside
> stream_check_interrupt.

Please ignore that part, I misremembered who wakes up whom.


More information about the MPlayer-dev-eng mailing list