Re: nicing idl at startup from idlwave [message #52143] |
Mon, 22 January 2007 09:22  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Mon, 22 Jan 2007 10:00:30 -0600, Christopher Thom wrote:
> Hi gang,
>
> A quick question -- does anyone know how to start idl from idlwave with a
> lower process priority? I tried setting idlwave-shell-explicit-file-name
> to something like "nice -5 idl" without any success. Looks like this needs
> to be the filename only, I presume since idl is started without recourse
> to the shell.
Probably the easiest is to make a shell script "niceidl" and reference
that directly in shell-explicit-filename. renice also could do the
trick post-facto, and a little elisp could make it much easier to use.
Stick this in your .emacs:
(defun renice-idl (&optional priority)
(interactive "NIDL Priority (nice): ")
(if (idlwave-shell-is-running)
(shell-command
(format "renice %d -p %d"
priority
(process-id (get-buffer-process (idlwave-shell-buffer)))))))
(idlwave-shell-define-key-both [f9] 'renice-idl)
Then hitting f9 will prompt for a nice value to set the IDL process
to. Note that you can only increase 'nice' on most systems (from
0-20). If you really want the same nice value every time you start
IDLWAVE, you can:
(add-hook 'idlwave-shell-mode-hook (lambda () (renice-idl 5)))
JD
|
|
|
|
Re: nicing idl at startup from idlwave [message #52290 is a reply to message #52143] |
Mon, 22 January 2007 11:15  |
Christopher Thom
Messages: 66 Registered: October 2006
|
Member |
|
|
Quoth JD Smith:
> On Mon, 22 Jan 2007 10:00:30 -0600, Christopher Thom wrote:
>
>> Hi gang,
>>
>> A quick question -- does anyone know how to start idl from idlwave with a
>> lower process priority? I tried setting idlwave-shell-explicit-file-name
>> to something like "nice -5 idl" without any success. Looks like this needs
>> to be the filename only, I presume since idl is started without recourse
>> to the shell.
>
> Probably the easiest is to make a shell script "niceidl" and reference
> that directly in shell-explicit-filename. renice also could do the
> trick post-facto, and a little elisp could make it much easier to use.
> Stick this in your .emacs:
duh. shell script. always miss the simple and obvious solutions. thanks
both. I just tried it and it works fine...will keep an eye out for
unexpected side-effects of have a shell layer in there.
btw -- i should have been a little more explicit: "nice -5" is a
somewhat historical usage, which lowers the priority (i.e. = nice -n +5
idl). at least, on my linux/mac machines.
cheers
chris
|
|
|