A background process is a
computer process that runs ''behind the scenes'' (i.e., in the background) and without user intervention.
Typical tasks for these processes include logging, system monitoring, scheduling, and user notification.
On a
Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
system, a background process is either a
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
that does not create a
user interface
In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine fro ...
, or a
Windows service. The former are started just as any other program is started, e.g., via
Start menu. Windows services, on the other hand, are started by
Service Control Manager. In
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
and later, they
are run in a separate session.
On a
Unix
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
or
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
system, a background process or job can be further identified as one whose
process group ID differs from its terminal group ID (TGID). (The TGID of a process is the process ID of the process group leader that opened the terminal, which is typically the login shell. The TGID identifies the control terminal of the process group.) This type of process is unable to receive keyboard signals from its parent terminal, and typically will not send output to that terminal.
This more technical definition does not distinguish between whether or not the process can receive user intervention. Although background processes are typically used for purposes needing few resources, any process can be run in the background, and such a process will behave like any other process, with the exceptions given above.
Windows services
In
Windows NT
Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
family of
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s, a Windows service is a dedicated background process.
A Windows service must conform to the interface rules and protocols of the
Service Control Manager, the component responsible for managing Windows services.
Windows services can be configured to start when the operating system starts, and to run in the background as long as Windows runs. Alternatively, they can be started manually or by an event. Windows NT operating systems
include numerous services which run in context of three
user account
A user is a person who uses a computer or network service.
A user often has a user account and is identified to the system by a username (or user name).
Some software products provide services to other systems and have no direct end use ...
s:
System
,
Network Service
and
Local Service
. These Windows components are often associated with Host Process for Windows Services:
svchost.exe. Since Windows services operate in the context of their own dedicated user accounts, they can operate when a user is not logged on.
Before
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
, services installed as "interactive services" could interact with Windows
desktop and show a
graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
. With Windows Vista, however, interactive services became
deprecated and ceased operating properly, as a result of
Windows Service Hardening.
The three principal means of managing Windows services are:
# Services snap-in for
Microsoft Management Console
#
sc.exe
#
Windows PowerShell
Daemon
A daemon is a type of background process designed to run continually in the background, waiting for event(s) to occur or condition(s) to be met. When launched with the ''daemon'' function, daemons are disassociated from their parent terminal.
Background jobs in Unix
From a Unix command line, a background process can be launched using the "&" operator. The ''bg'' command can resume a suspended job (sending
SIGCONT), running it in the background. Using the ''fg'' command will also reconnect standard input its parent terminal, bringing it into the foreground. The ''jobs'' command will list all processes associated with the current terminal and can be used to bring background processes into the foreground.
When a
login session ends, via explicit logout or network disconnection, all processes, including background processes, will by default be terminated, to prevent them from becoming
orphan processes. Concretely, when the user exits the launching shell process, as part of shutdown it sends a ''hangup'' signal (
SIGHUP) to all its
jobs, to terminate all the processes in the corresponding
process group. To have processes continue to run, one can either not end the session, or end the session without terminating the processes. A
terminal multiplexer can be used to leave a session running but detach a virtual terminal from it, leaving processes running as child processes of the session; the user can then reattach session later. Or, termination can be prevented by either starting the process via the
nohup command (telling the process to ignore SIGHUP), or by subsequently running
disown
with the job id, which either removes the job from the job list entirely, or simply prevents SIGHUP from being sent. In the latter case when the session ends, the child processes are not terminated, either because they are not sent SIGHUP or because they ignore it, and thus become orphan processes, which are then adopted by the
init process (the kernel sets the init process as their parent), and they continue running without a session, now called ''
daemons''.
Example
In this example running on
Unix
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
, the ''sleep'' utility was launched into the background. Afterward, the ''ps'' tool was run in the foreground, where it output the below text. Both were launched from the shell.
PID TT STAT TIME COMMAND
54659 10 S 0:00.06 su (zsh)
54703 10 IN 0:00.00 - sleep 1000
54852 10 R+ 0:00.00 - ps -U botty -axd
Smartphones
Many newer versions of
smartphone
A smartphone is a mobile phone with advanced computing capabilities. It typically has a touchscreen interface, allowing users to access a wide range of applications and services, such as web browsing, email, and social media, as well as multi ...
and PDA
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s now include the ability to start background processes. Due to hardware limits, background processes on mobile operating systems are often restricted to certain tasks or consumption levels. On
Android, CPU use for background processes may be bounded at 5–10%.
Applications on Apple's
iOS are limited to a subset of functions while running in the background.
On both iOS and Android, background processes can be killed by the system if they are using too much memory.
See also
*
Batch processing
*
Computer multitasking
In computing, multitasking is the concurrent computing, concurrent execution of multiple tasks (also known as Process (computing), processes) over a certain period of time. New tasks can interrupt already started ones before they finish, instea ...
*
Process group
References
{{DEFAULTSORT:Background Process
Process (computing)