[MPlayer-dev-eng] [PATCH] use pthreads for caching

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Jan 27 14:28:39 CET 2007


On Sat, 2007-01-27 at 13:42 +0100, A Mennucc wrote:
> [BTW: my opinion is that the cache code is not really relevant w.r.t.
> performance... it usually just wait in the usec_sleep , or in read()ing
> from the stream (if it is slow);
> moreover no one of my changes does really add or remove code  in the
> caching code]
>
> so the only worry is: does threading slow down the rest of mplayer code
> ? (and I mean: in codecs, where it really hurts)

IMO there is no need to benchmark; MPlayer does not use so many libc
calls that extra locking would affect performance (or if it does then
the code in question should be optimized regardless of thread use).

The current cache code isn't very good (the constant sleep times break
at high transfer rates with default cache size, it's not really safe
without locking) and a threaded version would probably be better.
However I don't see how just changing it to use a thread instead of a
process with no other changes would give any major improvements. Is
there still a reason why you want your previous patch applied (or why
are you talking about benchmarks)?




More information about the MPlayer-dev-eng mailing list