Professional Documents
Culture Documents
Operating System: Lecture #6-7 Process Management
Operating System: Lecture #6-7 Process Management
Lecture #6-7
Process Management
Objectives
• Cooperating and Independent Processes
• Inter process communication
• Process Management in Unix
Inter Process Communication
• Interprocess communication is the mechanism provided by the operating
system that allows processes to communicate with each other.
• When you start a process (run a command), there are two ways you can run it −
• Foreground Processes
• Background Processes
Foreground Processes
• By default, every process that you start runs in the foreground. It gets its input from the
keyboard and sends its output to the screen.
• You can see this happen with the ls command. If you wish to list all the files in your current
directory, you can use the following command −
• $ls ch*.doc
General Definition
• Foreground Processes: They run on the screen and need
input from the user. For example Office Programs
• Background Processes: They run in the background and
usually do not need user input. For example Antivirus.
Running a Foreground Process
• To start a foreground process, you can either run it from the dashboard,
or you can run it from the terminal.
• When using the Terminal, you will have to wait, until the foreground
process runs.
Background Process
Background Processes
A background process runs without being connected to your keyboard. If the background process
requires any keyboard input, it waits.
The advantage of running a process in the background is that you can run other commands; you do
not have to wait until it completes to start another!
The simplest way to start a background process is to add an ampersand (&) at the end of the
command.
$ls ch*.doc &
Types of Processes
• Zombie Process:- A Zombie is a process that has completed its task but
still, it shows an entry in a process table. The zombie process usually
occurred in the child process. Very short time the process is a zombie.
After the process has completed all of its tasks it reports the parent
process that it has about to terminate.
• Zombie is unable to terminate itself because it is treated as a dead process.
So parent process needs to execute to terminate the command to terminate
the child
2. Orphan Process :
•
A child process that remains running even after its parent process is
terminated or completed without waiting for the child process execution is
called an orphan. A process becomes an orphan unintentionally. Some
time intentionally becomes orphans due to long-running time to complete
the assigned task without user attention. The orphan process has
controlling terminals.
3. Daemon process :
•
Daemon processes are started working when the system will be
bootstrapped and terminate only when the system is shutdown .It does not
have a controlling terminal. It always runs in the background.