[MPlayer-users] An Error about the critical section

Arpi arpi at thot.banki.hu
Fri Nov 1 02:48:02 CET 2002


Hi,

> If i enable the cache,Then the mplayer run in 2 processes.But i found that
> this two processers share the cache.So the things in the cache_var_t
> struct are critical sections.
> They will make problems.And in actural,when i modified the config file
> with cache < 100,the problem is so severe that it can not decode audio or
> video right.But in the file of "cache.c",i find "Note it runs in 2
it won't work with too small (<64k) cache size, it's a known limitation

> processes (using fork()), but doesn't requires locking!!" .
> 	
> why u think there is no need of locking??   // confusing!! 
i don't think, i know.
understand how does it work, and then you'll see the trick.
and yes, i'm 1000% sure it doesn't need locking, it was the primary
design goal i my mind. no need to locking -> no locking -> no deadlocks :)

the 'lockup' with too small cache size happens as there is not enough free
buffer to read more but there is not enough data to read at all, so it
enters an endless loop. it has nothing with locking, it happens in the same
process. anyway unless you mess with the code, it will never happen.
it could be fixed, but it doesn't worth, <64k cache is just useless.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu




More information about the MPlayer-users mailing list