Q . What is a 'Nice' Value?

A. Every process has its own priority. by default its value is '0', this value varies from -20 to +19.

   -20 is highest priority, +19 is lowest priority.


Q. How to check the 'Nice' value of a process?

A.  'Nice' value can be found using ps, top, htop command. 'NI' column represents the Niceness value

eg:  run 'htop' on terminal, the value under column 'NI' gives nice value of the given process


Q. How to run a process(say proc1) with a given nice value? ex: run a process with nice value = -5

A. nice --5 ./proc1

Explanation to set nice value run

nice -(nice value) program_name


Q. How to run a process(say proc1) with a given nice value? ex: run a process with nice value = +10

A. nice -10 ./proc1


Q. How to change nice value of running process(with PID say 3212)? eg say a process(with PID 3212) is running with nice value = +5, now change the process nice value to -2

A. Use renice command shown below

renice -n 5 -p 3212


Q. Which scheduling Algorithm is used for Process scheduling in Linux?

A.  Completely Fair Scheduler(CFS) is used as default scheduling Algorithm.


Q. What is a Time slice in OS?

A.  The amount of time which a scheduler gives for a process to run on the Processor(CPU) is called time slice.


Q. Name few scheduling Algorithm?

A. First come first serve,  priority based scheduler, Shortest remaining time, Round Robin, CFS