[vlc-devel] commit: Use mwait and remove silly msleep usage ( Rémi Denis-Courmont )

Laurent Aimar fenrir at via.ecp.fr
Sun Sep 7 15:43:24 CEST 2008

On Sun, Sep 07, 2008, Rémi Denis-Courmont wrote:
> Le dimanche 7 septembre 2008 15:10:51 Laurent Aimar, vous avez écrit :
> > The demuxer cannot wait a long time as it will block the input thread.
> > Play/pause/... will not work while the mwait is executed. With delay >
> > 300ms it can become very annoying.
> There is no excuse for a general application to repeatedly sleep 400 
> microseconds. This inhibits proper scheduling and CPU idle. Also, sleeping 
> less than the scheduler frequency (100 to 1000Hz depending on your build) 
> typically will either not work, or turn into a busy loop against the real 
> time clock (the OS won't suspend the thread for such short time).
> Don't get me started on how completely lame and brain dead that is 
> specifically for a *multimedia* application as VLC, where you definitely 
> don't want to interrupt the audio output thread by a lame non-time critical 
> interface or demuxer.
 Wooooww, calm down.
 I just pointed out to limit the duration of the mwait to somthing like
300 *millisecond*.

 Fixing it properly is another problem that will need a revision of the
input/demuxer API and that can be done latter.


More information about the vlc-devel mailing list