Unit 2
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
• Syntax:
• ‘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.