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

Rémi Denis-Courmont rem at videolan.org
Sun Sep 7 15:31:49 CEST 2008


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.

It's not my fault if other programmers are too lazy or too incompetent to 
handle events properly. If the code had been written correctly to start with, 
there would be no such problems to beging with.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list