2. Take the output of the ps command and identify which are the processes being run by you. Trace the tree to the root for two of these processes. Verify that the root of the tree is the init process. Explain what commands or process you used to trace the tree. (2 Marks)
3. Many CPU scheduling algorithms are parameterized. For example, the RR algorithm requires a parameter to indicate the time slice. Multilevel feedback queues require parameters to define the number of queues, the scheduling algorithms for each queue, the criteria to move processes between queues and so on.
These algorithms are thus really sets of algorithms (for e.g., the set of RR algorithms for all time slices and so on). One set of algorithms may include another (for e.g., the FCFS algorithm is the RR algorithm with an infinite time quantum). What (if any) relation holds between the following pairs of sets of algorithms? (2 Marks)
Write a program to read the /proc filesystem and print the following for all the processes listed there:
PID, PPID, STATE, COMMAND, No. of Files open
Since for all the root or privileged processes, you are not allowed to read the no. of files open, print NA for those. For all user processes, print the no. of files open.
Below are some Hints for the assignment.
1. Exercise 7.8
2. Exercise 8.4
3. Exercise 8.11(a)