0% found this document useful (0 votes)
10 views104 pages

Unit 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views104 pages

Unit 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 104

Unit 2

Process Management
Process
Process
Process
Program, Job and Process
Schedulers
If fork() returns a negative value, the creation of a child process was unsuccessful.
fork() returns a zero to the newly created child process.
fork() returns a positive value, the process ID of the child process, to the parent.
Execute the process scheduling using
Preemptive priority based scheduling.
Linux Commands for Process management
• ps
• The ps command, short for Process Status, is a command line utility that is used to display or
view information related to the processes running in a Linux system.
• Linux is a multitasking and multiprocessing system. Therefore, multiple processes can run
concurrently without affecting each other. The ps command lists current running processes
alongside their PIDs and other attributes.
pstree

• Pstree command in Linux that shows the running processes as a


tree which is a more convenient way to display the processes
hierarchy and makes the output more visually appealing. The root
of the tree is either init or the process with the given pid. Pstree
can also be installed in other Unix systems.

• Syntax:

• pstree [options] [pid or username]


Nice and Renice Command
• In Linux, managing process priority is crucial for optimizing system performance, especially
in environments where multiple processes compete for CPU resources. The nice and renice
commands allow users to adjust the scheduling priority of processes, influencing how the
Linux kernel allocates CPU time among them.

• ‘nice’ Command: This command is used to start a new process with a specific priority, known
as the “nice value.” A higher nice value lowers the process’s priority, while a lower (negative)
nice value increases it. Processes with higher priority receive more CPU time.
• ‘renice’ Command: Unlike nice, which sets the priority when starting a process, renice
modifies the priority of an already running process. This flexibility allows system
administrators to manage process priorities based on the current system load dynamically.

You might also like