Question: Task 1 : To implement priority scheduling, you will first need to do the following: ( 1 ) Add a variable in struct proc to

Task 1: To implement priority scheduling, you will first need to do the following:
(1) Add a variable in struct proc to indicate the nice level of a process. Use a range
of 0 to 20, with 20 being the lowest and 0 the highest priority.
(2) Determine the default priority of a process when it is created and add the code to
do so. Usually, it is somewhere in the middle of the range.
(3) Implement a system call:
int setnice(int pid, int n);
to change the nice value of process pid to n. The returned value should be the
original nice value of this process.
(4) Implement a second system call:
int getnice(int pid);
that returns the nice value of a process.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!