[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDL and 'nice' question




In article <onsngkaabp.fsf@cow.physics.wisc.edu>, Craig Markwardt <craigmnet@cow.physics.wisc.edu> writes:
> 
> Randall Skelton <rhskelto@atm.ox.ac.uk> writes:
> 
> 
> > Hi all,
> > 
> > I have a question regarding setting the priority of IDL on a *nix
> > operating system.  There are certain instances when it is desirable to
> > set the priority of idl to a lower priority with the nice command.  Of
> > course, typing 'idl' at the command-line is actually a front-end to a shell
> > script and not an actual binary.  Are there any foreseeable problems in
> > starting the idl binary directly with 'nice -19 $IDL_DIR/bin/idl' as
> > opposed to staring the shell script?
> 
> Before you go get yourself all twisted in a knot of DLMs, I think
> things are alot easier than you thing.
> 
> First thing, I think you are confusing low and high priority.  For the
> non-unix among us, the "nice" command allows a user to set the process
> priority, which is essentially how much attention the CPU will give a
> program.  Running programs with low priority are readily bumped in
> favor of higher priority programs.  A *positive* nice number indicates
> a lower priority -- it is more "nice" to others; a negative nice
> number is a higher priority.  Thus your use of "-19" and "low
> priority" don't seem to be the right mix.

If you are a windows user I would recommend that you skip press the "next"
button, or whatever goes onto the next message in your newsreader.

Actually the value -19 is the lowest priority you can normally set with
nice. It's one of the quirks of the nice command that the argument looks
like a negative number but actually means increase the nice value by that 
amount. This *is* UNIX, you have to expect these idiosyncrasies.

Most versions of nice now accept a more reasonable argument "-n nice_value" 
which is unsigned for an increase in "niceness" and negative for a decrease.

> 
> Second, I believe that a process's "nice" level is inherited by any
> subprocesses.  [ That has to be the case, otherwise a program could
> escape it's priority constraints by spawning a new copy of itself. ]
> So it shouldn't matter that the "idl" command is a script.

Indeed. In fact, the script exec's the IDL binary so it is actually the
same process with the same nice value.

-- 
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
            University of Leicester, Leicester, LE1 7RH, UK 
E-mail :    nmw@ion.le.ac.uk 
Phone :     +44 (0)116 2523568, Fax : +44 (0)116 2523555