What r foreground & background process

Galibore

Joined May 22, 2012
20
Hi aamirali,

It depends on the context.

A background process is something that normally runs without needing any intervention from a user. E.g. typically it wouldn't have a user interface. Often background proceses run continuously or "sleep" until there is something to do.

A foreground process is roughly, an application with which a user interacts.

When it comes to MS Windows for instance, the server operating systems optimize processing for background processes and desktop operating systems are optimized for foreground processes.

I say all this assuming you really mean processes and not threads for which you'd need a different explanation.

Hope this helps.
 

Papabravo

Joined Feb 24, 2006
21,225
A little more detail. Normally foreground processes run as the result of interrupts. Interrupt Service Routines (ISR) are "supposed" to be short, small pieces of code that capture a little bit of information from a hardware interrupt and pass it to a foreground process. Foreground processes typically run with all interrupts enabled. When there are no interrupts and no foreground processes ready to run the background process runs until the next interrupt or other event that triggers the running of a foreground process.
 

MrChips

Joined Oct 2, 2009
30,821
Foreground and background processes are usually independent programs running concurrently (at the same time).

For example, you could be doing word processing in the foreground while a background program is scanning, copying or printing another file. The foreground task is given priority over background tasks.
 
Top