Background process

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

A background process is a computer process that runs "behind the scenes" (i.e. in the background) and without user intervention.[1] Typical tasks for these processes include logging, system monitoring, scheduling,[2] and user notification.[3]

On a Windows system, this term may be used to either refer to a computer program that does not create a user interface, 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 and later, they are run in a separate session. There is no limit on how much a system service or background process can use system resources. Indeed, in Windows Server family of Microsoft operating systems, background processes are expected to be the principle consumers.

On a Unix or Unix-like system, a background process or job can be further identified as one whose group ID differs from its terminal group ID. This type of process is unable to receive keyboard signals from and typically will not send output to its parent terminal.[4] 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 requiring few resources, any process can be run in the background, and even though the process is running in the background, where it can't be seen, it behaves like any other process.[1]

Windows services

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

In Windows NT family of operating systems, a Windows service is a dedicated background process.[5] A Windows service must conform to the interface rules and protocols of the Service Control Manager, the component responsible for managing Windows services.[6]

Windows services can be configured to start when the operating system is started and run in the background as long as Windows is running. Alternatively, they can be started manually or by an event. Windows NT operating systems include numerous services which run in context of three user accounts: System, Network Service and Local Service. These Windows components are often associated with Host Process for Windows Services. Since Windows services operate in the context of their own dedicated user accounts, they can operate when a user is not logged on.

Prior to Windows Vista services installed as "interactive services" could interact with Windows desktop and show a graphical user interface. With Windows Vista, however, interactive services are deprecated and may not operate properly, as a result of Windows Service Hardening.[7][8]

The three principal means of managing Windows services are:

  1. Services snap-in for Microsoft Management Console
  2. sc.exe
  3. Windows PowerShell

Daemon

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

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.[9] These processes typically use minimal system resources and perform tasks which require little to no input from the user. When launched with the daemon function, daemons are disassociated from their parent terminal.[10]

Launch & resumption on Unix

From a Unix command line, a background process can be launched using the "&" operator. The bg utility can resume a suspended job, running it in the background. Using the fg utility will associate a background process with its parent terminal, bringing it into the foreground. The jobs utility will list all processes associated with the current terminal and can be used to bring background processes into the foreground.[4][11]

Example

In this example running on Unix, 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.[12]

  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 & PDA operating systems now include the ability to start background processes. Due to hardware constraints, background processes on mobile operating systems are often restricted to certain tasks or consumption levels. On Android, CPU usage for background processes is bounded at 5 - 10%.[13] Third-party applications on Apple's iOS are limited to a certain set of functions while running in the background.[3] On both iOS and Android, background processes can be killed by the system if they are using too much of the system's memory.[3][13]

See also

References

  1. 1.0 1.1 Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 3.2 Lua error in package.lua at line 80: module 'strict' not found.
  4. 4.0 4.1 Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. 13.0 13.1 Lua error in package.lua at line 80: module 'strict' not found.