Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Feb 2004 16:27:16 +0300
From:      Sergey 'DoubleF' Zaharchenko <doublef@tele-kom.ru>
To:        zhangweiwu@realss.com
Cc:        questions@freebsd.org
Subject:   Re: scheduling priority not working?
Message-ID:  <20040229162716.15dca0ff@Hal.localdomain>
In-Reply-To: <Law11-F26DplxgM2x1T000162a5@hotmail.com>
References:  <Law11-F26DplxgM2x1T000162a5@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Sun__29_Feb_2004_16_27_16_+0300_rWePAtX2E5+PhPtr
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

On Sun, 29 Feb 2004 19:07:12 +0800
"Zhang Weiwu" <weiwuzhang@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"

--Signature=_Sun__29_Feb_2004_16_27_16_+0300_rWePAtX2E5+PhPtr
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAQejAwo7hT/9lVdwRAvcSAJ4wjDWdQIeMploNzN+0WiHJnlk/9ACfa2JW
ehGKQ6g/YoP2v0rEC0IKUro=
=as7p
-----END PGP SIGNATURE-----

--Signature=_Sun__29_Feb_2004_16_27_16_+0300_rWePAtX2E5+PhPtr--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040229162716.15dca0ff>