Yes, it would be entirely possible for me to use an alias or a wrapper script, or a back door kludge in bash, or a regexp renicer in the Darwin kernel, or a billion monkeys with typewriters to achieve the same thing at varying levels of reliability and reusability. However, there are reasons why I prefer to integrate "nice" into fink rather than apply one of these methods.
On slower computers, you typically want to put long batch jobs on a lower priority. Problem is, you don't necessarily know how long a job is beforehand, hence you often find that you want to renice a running process or restart it with a lower priority. Having a default (low) priority for fink compiles would be, well, *nice*. Having a fink install last 2-5% longer (wall clock time) is an acceptable tradeoff if you can still use your computer while the compile is in progress.
Case in point: I tend to update my fink installation when I don't have much else to do. It typically goes like this. Step 1) "fink selfupdate-cvs; fink update-all". Step 2) Notice that there still isn't much to do. Step 3) Start EV Nova or DivX movie. Step 4) Notice that frame rate is abysmal because of fink compilation that *looks* like it's in the background, but competes with foreground app for CPU time anyway. Step 5) Realise the obvious, curse own stupidity. Step 6) Try to renice fink manually. Step 7) Hit head on table. Step 8) Repeat from step 1 a few times on different occasions. Step 9) Decide to fix this in a clean way once and for all.
Fink is in itself an application that depends on many other unix commands (sudo, curl, dpkg). Renicing is a similar detail that can be implemented in a similar way. Kludging Engine.pm like I did just now is not a good solution, rather fink should have a configuration option.
Having dozens of configurable options is not automatically a good thing. For an extreme example, look at sendmail which allows you to configure literally hundreds of things in at least three different ways. Currently, fink has a small and well chosen set of options, and adding new ones is not automatically bad -- provided that the new options are chosen sensibly. I feel that a "nice" option would be a valuable addition to the current set. I like to use a priority of 20. Someone else might want 0. The default could be 5.
The perl code doesn't have to be messy. And the subtle "that can't be the problem" differences between installations will not be a problem if it's a supported configuration option, will it?
--Martin
On tiistai, joulu 3, 2002, at 11:44 Europe/Helsinki, [EMAIL PROTECTED] wrote:
How about a shell solution? In bash (probably in ~/.bashrc):Hello,I like to run fink at a low priority to keep my puny G3 iBook somewhat responsive. When I finally got tired of typing "nice -20 fink ..." every time, I took a look at the perl libraries and added the following just before line 200 in Engine.pm: $cmd = "nice -20 " . $cmd; Could this be added to fink as a configuration option? --Martin
alias nf='nice -20 fink'
creates an alias called "nf" (short for "nice fink," of course!)
that expands to "nice -20 fink." So when you type, e.g.:
nf install somepackage
bash expands the alias and "pretends" that you typed:
nice -20 fink install somepackage
No configuration options. No messy perl code. No subtle "that
can't be the problem" differences between your installation and
mine.
I'm sure csh and its variants support aliases (and may, in fact,
have inspired that feature in bash), but someone else will have
to post the exact syntax.
HTH,
Dan
--
<mailto:[EMAIL PROTECTED]>
<http://www.tombstonezero.net/dan>
An omer is a tenth of an ephah. -- Exodus 16:36.
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Fink-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-users
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Fink-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-users
