scheduling priority not working?
Sergey 'DoubleF' Zaharchenko
doublef at tele-kom.ru
Sun Feb 29 05:28:42 PST 2004
On Sun, 29 Feb 2004 19:07:12 +0800
"Zhang Weiwu" <weiwuzhang at hotmail.com> probably wrote:
> Sergey 'DoubleF' Zaharchenko wrote:
>
> >There's more than nice to change priority; for example, check out
> >rtprio(1) and idprio(1). Just FYI.
> >
> GREAT TOOL rtprio(1) is. Now I can run 'rtprio 5 mpg321 *.mp3' it produce
> very smooth sound.
Are you running the MP3 player as root? I wouldn't recommend it. I'd
make a script using sudo and su'ing back to myself just after the
priority change. FWIW this is what I use for listening to my music:
sudo /usr/sbin/rtprio 5 /usr/bin/su df -c "/usr/local/bin/splay -s -2 /home/df/music/*" &
Of course, I changed the suders file accordingly and wrote a script
`mus' which includes the quoted line.
rtprio is really powerful, and that's why it may be a bit
dangerous. If a program which has run-time priority gets into a large
amount of calculations, or into a busy-wait loop, all other programs
will starve (the machine will appear hung). If you don't trust your
MP3 player (or any program you set to have run-time priority) to be
bullet-proof, you should think twice before using rtprio. Not that I
have found many misbehaving programs, but I sometimes happen to write
one:)
--
DoubleF
Truthful, adj.:
Dumb and illiterate.
-- Ambrose Bierce, "The Devil's Dictionary"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040229/e01721eb/attachment.bin
More information about the freebsd-questions
mailing list