How to set priority of a running task

How to set priority of a running task

Post by David Gea » Sun, 02 Dec 1990 20:06:00



Does anyone know how to reset a task's priority while it is running?
I know that I can set a task's priority when I execute it using
nice, but I want to set it while it is running.  I've heard of
renice, but we don't have it.  Any other way??

Thanx,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~       "...You may be right,                              ~
~           I may be crazy,                             ~
~           but it just may be a lunatic                ~
~           you're looking for..."                 ~
~                                                       ~
~               "You May Be Right", Billy Joel                ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
***********************************************************
* David Geary, Boeing Aerospace Co., Seattle, WA          *
* (206)773-5249.  --I disclaim everything I've ever said--*
***********************************************************

 
 
 

How to set priority of a running task

Post by Dave Ste » Mon, 03 Dec 1990 00:22:00



>Does anyone know how to reset a task's priority while it is running?
>I know that I can set a task's priority when I execute it using
>nice, but I want to set it while it is running.  I've heard of
>renice, but we don't have it.  Any other way??

You didn't say what flavour of UN*X you're running, but on BSD 4.2/3
and those based on BSD (like Sun 3.X), you can use the setpriority
system call to accomplish this.

Excerpt reprinted without permission...

GETPRIORITY(2)      UNIX Programmer's Manual       GETPRIORITY(2)

NAME
     getpriority, setpriority - get/set program scheduling prior-
     ity

SYNOPSIS
     #include <sys/resource.h>

     ...

     setpriority(which, who, prio)
     int which, who, prio;

DESCRIPTION
     ...

     The setpriority call sets the priorities of all of the
     specified processes to the specified value.  Only the
     super-user may lower priorities.

I don't know if it's available on Sys V.  Anyone?

Dave Stein                                                  "Life's a clambake."

UUCP: ...ucbvax!hub!csilvax!angst                         need no disclaimers!

 
 
 

1. ?Setting task priority

How do go about setting the task priorities in SCO and
Linux?
--
------------------------------------------------------------------------

120megs /               /*//_\                         "Amigo Man"
6 megs /              \*//     \miga                  Mostly Harmless ..

2. Defragger in Linux?

3. Task Priorities

4. Opinions on Linux on SPARC systems....

5. Tasks and Priorities

6. RAID 10 jfs: surprisingly different bonnie++ file creation times

7. Priority que's and task switching

8. exchange server

9. Is task->priority for time slice ?

10. what is "priority inversion/priority inheritance" ?

11. Task States; can't kill 'D' tasks

12. Ignoring tasks by task bar

13. problem while putting task in task queue!!