Process priorities question


Hi ,
   I want to propose you a small challenge for 200 points,it's a theoric question.
I want the unix law who permits to determine processes priority.

         good luck;-)
 
 
LVL 1
farajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tfewsterCommented:
AFAIK , process priority="nice" value under HP-UX (as shown by ps -l) and processing time is equally distributed among processes with the same nice value (by default, every process gets the same priority)

Solaris is more sophisticated, splitting processes into 4 classes: system, real-time, time-sharing & interactive, each with its own scheduling policy. man priocntl explains this in detail!
0
chris_calabreseCommented:
Sounds suspiciously like a homework problem, but I'll bite anyway...


As tfewster aluded to, most modern commercial Unix flavors have multiple process classes with their own scheduling priorities.  However, within each class, things operate very similarly to the traditional mechanisms as described in the Bach and Leffer et. al books.

This is from Leffer, McKusick, Quarterman, and Karels' _The Design and Implementation of the 4.3 BSD Operating System_

    "A process's scheduling priority is directly determined by two values contained in the proc structure: p_cpu and p_nice.  The value of p_cpu provides an estimate of the recent CPU utilization of the process.  The value of p_nice is a user-settable weighting factor that ranges numerically between 020 and 20.  The normal value for p_nice is 0.  Negative values increase a processes' priority, whereas positive values decrease its priority.
    A process's user-mode scheduling priority is caluculated every four clock ticks (40 milliseconds on a VAX) by this equasion
        p_usrpri = PUSER = (p_cpu / 4) + 2 * p_nice
    Values greater than 127 are clamped to 127.  This calculation causes the priority to decrease linearly based on recent CPU utilization.  The user-controllable p_nice parameter acts as a limited weighting factor.  Negative values retard the effect of heavy CPU utilization by offsetting the additive term containing p_cpu.  Otherwise, if one ignores the second ter, p_nice shifts the priority by a constant factor.
    The CPU utilization, p_cpu is incremented each time the system clock ticks and the process is found to be executing.  In addition, p_cpu is adjusted once per second using a digital decay filter.  The decay causes abput 90 percent of the CPU usage accumulated in a 1-second interval to be forgotton over a period of time that is dependent on the system load average.  To be exact, p_cpu is adjusted according to
        p_cpu=((2*load)/(2*load+1))*p_cpu+p_nice
where the load is a sampled average of the length of the run queue over the previous 1-minute interval of the system operation."


Etc.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.