comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL and 'nice' question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL and 'nice' question [message #25535] Thu, 28 June 2001 09:06
nmw is currently offline  nmw
Messages: 18
Registered: January 1995
Junior Member
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
Re: IDL and 'nice' question [message #25536 is a reply to message #25535] Thu, 28 June 2001 08:33 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
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.

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.

If you really need to nice the binary itself, why not copy the
existing idl script to a new file called "niceidl" and add the nice
command at the last step?

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: filled closed curve
Next Topic: Test. Please Disregard.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 11:28:50 PDT 2025

Total time taken to generate the page: 0.24307 seconds