From owner-freebsd-questions@FreeBSD.ORG Sun Feb 29 05:28:42 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5F7716A4CE for ; Sun, 29 Feb 2004 05:28:42 -0800 (PST) Received: from mx.tele-kom.ru (mx.tele-kom.ru [213.80.148.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 3205D43D2D for ; Sun, 29 Feb 2004 05:28:41 -0800 (PST) (envelope-from doublef@tele-kom.ru) Received: (qmail 21792 invoked by uid 555); 29 Feb 2004 16:28:39 +0300 Received: from hal.localdomain (213.80.149.161) by t-k.ru with TeleMail/2 id 1078061318-21779 for zhangweiwu@realss.com; Sun, 29 Feb 16:28:38 2004 +0300 (MSK) Date: Sun, 29 Feb 2004 16:27:16 +0300 From: Sergey 'DoubleF' Zaharchenko To: zhangweiwu@realss.com Message-Id: <20040229162716.15dca0ff@Hal.localdomain> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-portbld-freebsd4.8) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Sun__29_Feb_2004_16_27_16_+0300_rWePAtX2E5+PhPtr" cc: weiwuzhang@hotmail.com cc: questions@freebsd.org Subject: Re: scheduling priority not working? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Feb 2004 13:28:42 -0000 --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" 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--