[MPlayer-dev-eng] threaded cache instead for forked?

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Nov 7 19:55:05 CET 2011


On Sun, Nov 06, 2011 at 06:14:52PM +0100, Dan Oscarsson wrote:
> Currently the caching code forks on Linux, uses threads on ms windows,
> from what I can see. I have looked at the code and enable threading on
> Linux too, and what I can see if works fine. Is there some reason why we
> still use fork instead of threads? Threads are used today in other parts
> of mplayer or its libraries.
> 
> Using fork can result in the cache process left running when mplayer
> crashes.
> 
> Looking at the code I see that I could add threaded sematics to enable
> control operation to wake up caching thread immediately, and there is
> one place where the code loops on the cpu waiting for cache
> thread/process to complete a control operation.

Well, as you see yourself there are things that can be done to improve
it and probably there are things that _should_ be done before making
it the default.
In particular, testing it properly.
There is also a bit the point of avoiding fragmenting the cases to test
even more, if we make it the default there is a good chance enough
people do still not have pthreads and/or don't want it used that we
end up with 3 cache implementations in common use instead of just 2.


More information about the MPlayer-dev-eng mailing list