FOR FREE MATERIALS

Foreground and Background Process

 

There are two type of processes 

i) User process: User processes are executed in user mode (Non-privileged mode) and user process can be preempted or suspended at the time of executing. User processes execute user code.

 

ii) System process: System processes are executed in privileged mode and system processes executed automatically as per requirement without preemption. Operating-system processes execute system code.

 

There are two ways by which you can run the process 

Foreground processA foreground process is a simple job/process that runs directly in the foreground (Screen) using GUI or CUI mode. This type of process is initiated and executed by the user intervention i.e. it needs certain inputs from the user and gives some output on the screen.

 

Example: 

a) In Linux when we write lscommand in prompt then it shows output directly on the screen.

b) Office Program in windows. 

 

Disadvantage: 

When one process is running a long time in the foreground then no other program can be run because the prompt is not available until the previous one completed.

 

Background Process:

A process is called a background process when it is run behind (background) the system and without user intervention (No need of user input). Generally, the background process is a child process generated by a control process for processing long-time computational tasks. Processes that stay in the background to handle some activity such as e-mail, Web pages, news, printing, and so on are called daemons. 

 

Example: System Monitoring, Scheduling, Logging, Antivirus, etc.

 

Advantages: 

Though one long process is running in the background, we can run another process because a prompt is available.