{
  "id": "process-computing",
  "title": "Process (Computing)",
  "lang": "en",
  "source_lang": "en",
  "summary": "A process is an operating-system-managed instance of program execution, combining execution state, resources, and a protection context.",
  "category": "computer-science",
  "subcategory": "software",
  "type": "concept",
  "aliases": [
    "Computer process",
    "Operating-system process"
  ],
  "generated_at": "2026-11-03",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/process-computing/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/process-computing/",
      "json": "https://aiwiki.page/zh/process-computing.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A process is an instance of a program in execution, together with the resources and administrative state through which an operating system manages that execution. In a typical general-purpose system, a process has an address space, one or more execution threads, access to files and other objects, and an identity used for accounting and access control. A program is a description of computation; a process is a live realization of it. Several processes can execute the same program independently, and a single process can execute different program images during its lifetime.\n\nThe process abstraction allows a computer to support multiple activities while controlling their access to processors, memory, and devices. It underlies interactive applications, background services, command interpreters, and many server architectures. Processes also provide important boundaries for fault containment and security, although their strength depends on the operating system and its configuration.\n\nThe meaning of “process” varies somewhat across systems. Modern operating systems commonly separate the process as a resource container from the thread as a schedulable execution stream. Some programming environments also call lightweight, runtime-managed activities “processes,” even when they do not correspond individually to operating-system processes."
    },
    {
      "heading": "Execution model and process representation",
      "text": "A process combines an executing computation with a managed environment. Its program image normally includes executable instructions, initialized data, uninitialized storage, dynamically allocated memory, and stacks. Its execution state includes the location of the next instruction and the register values needed to continue computation. In a multithreaded process, each thread has its own instruction pointer, register context, and stack, while sharing much of the process environment.\n\nThe operating system maintains information that cannot simply be inferred from the program’s memory. This includes identifiers, scheduling attributes, security credentials, resource limits, relationships to other processes, and references to open objects. Textbooks commonly collect this information under the name process control block, or PCB. Actual implementations distribute it across several structures. Linux, for example, represents individual tasks using task_struct objects and uses additional, potentially shared structures for memory mappings, filesystem information, and other resources.\n\nA process identifier, or PID, names a process within a particular identifier domain. It is not generally a permanent identity: an operating system may reuse a PID after the previous process has disappeared. Consequently, a stored number alone may eventually designate a different process. Some interfaces provide stronger references, such as Linux PID file descriptors or Windows process handles. These refer to kernel-managed objects rather than relying solely on repeated lookup of a numeric identifier.\n\nResources associated with a process need not be owned by it exclusively. Two processes may map the same executable pages, inherit references to the same open file description, or deliberately share a memory region. Conversely, two references that look similar at application level may lead to independent kernel objects. For example, separately opening the same file is not equivalent to inheriting a reference to an existing open file description: file offsets and status flags can behave differently.\n\nThe process abstraction is therefore neither simply “a program in memory” nor an entirely isolated virtual computer. It is a structured collection of execution contexts and resource relationships. Its boundaries are defined partly by the kernel, partly by the platform’s application binary interface, and partly by higher-level conventions. A process normally interacts with protected operating-system services through a system call, which transfers control into the kernel under a controlled interface. This permits the operating system to validate requests rather than allowing ordinary application instructions to manipulate arbitrary system resources."
    },
    {
      "heading": "Historical development and operating-system traditions",
      "text": "The process abstraction developed alongside multiprogramming and time-sharing during the 1950s and 1960s. Early batch systems organized work largely as jobs: a submitted program and its associated input were loaded, executed, and followed by another job. Multiprogramming kept several computations available so that the processor could perform useful work while another computation waited for input or output. This required explicit representations of suspended execution, ownership of resources, and decisions about which computation should run next.\n\nTime-sharing made these requirements visible to interactive users. The Compatible Time-Sharing System, first demonstrated at MIT in 1961, and the Multics project, begun in 1964, helped establish systems in which many user activities appeared to progress independently. Saving and restoring execution state became fundamental to providing responsive interaction. Developments in memory protection and address translation also made it possible to separate computations more effectively than systems that relied primarily on programming discipline.\n\nUnix, developed at Bell Labs beginning in 1969, established an especially influential process interface. Its combination of process creation, executable-image replacement, waiting, signals, and file descriptors supported a compact model of program composition. A command interpreter could create a child process, arrange its input and output, and then replace the child’s program image with the requested executable. The shell itself did not need to implement the executable’s internal behavior.\n\nUnix also made process relationships central to system organization. A parent could obtain a child’s termination status, while process groups and sessions supported coordinated treatment of related activities. Pipelines connected separate programs through kernel-managed byte streams. These mechanisms encouraged applications composed of cooperating tools rather than requiring every operation to occur inside one executable. Later standardization through POSIX preserved a substantial common interface across otherwise different Unix-like systems.\n\nOther operating-system families developed different object models. In the Windows NT architecture, introduced commercially in 1993, a process is an executive object containing an address space and resources, while threads are the entities scheduled for execution. Process creation normally establishes a new process and an initial thread rather than exposing the Unix fork-then-exec sequence as its basic application interface. Object handles provide controlled references to processes and many other system objects.\n\nModern systems combine these traditions with newer mechanisms. Linux supports a Unix-like process interface but internally uses a flexible task-creation model in which selected resources can be shared. Windows exposes extensive process, thread, token, and job-object facilities. These differences mean that “process” is a broadly shared abstraction, not a specification requiring identical creation rules, inheritance behavior, or internal data structures."
    },
    {
      "heading": "Creation, state transitions, and termination",
      "text": "A process passes through states determined by both its own actions and operating-system events. A simplified model distinguishes ready, running, and blocked states. A ready execution context can run but is waiting for processor time; a running one is currently executing; a blocked one cannot proceed until some condition is satisfied. Actual kernels add distinctions for stopped tasks, different kinds of sleep, termination, and other implementation needs. For multithreaded applications, these states usually apply most directly to individual threads rather than to the process as a whole.\n\nIn the Unix model, fork() creates a child process with an initially similar execution environment. Parent and child continue from the creation call but receive different return values. They have distinct process identities and logically separate address spaces, although physical memory can initially be shared through implementation techniques. The exec family then replaces the calling process’s program image. Successful execution of an exec function does not create a new process: the existing process continues with a different program, generally retaining its PID.\n\nExecutable loading requires more than copying instructions into memory. The loader establishes mappings, prepares initial arguments and environment information, and arranges the initial stack. Dynamically linked programs also require a runtime linker to locate shared libraries and perform necessary relocations. Certain inherited resources survive image replacement, while others are reset or closed according to platform rules. On Unix-like systems, the close-on-exec attribute controls whether particular file descriptors remain open across this boundary.\n\nTermination can be voluntary, caused by an unhandled fault or signal, or initiated by another authorized actor. The operating system releases resources, records termination information, and notifies interested parties. Unix distinguishes terminating a process from collecting its status. A terminated child may remain as a zombie until its parent performs an appropriate wait operation. The zombie retains limited bookkeeping information, not a functioning address space or runnable program. An orphan, by contrast, is a process whose parent has terminated; it may still be running normally.\n\nParent-child relationships do not necessarily imply shared fate. On Unix-like systems, a child can often outlive its original parent and be adopted by a designated reaper, such as an init process or a configured subreaper. Service managers such as systemd add lifecycle policies above the basic kernel mechanisms, including restart behavior and coordinated shutdown. Windows job objects provide another way to group processes for management and resource policy.\n\nCorrect lifecycle management also requires attention to partial failure. Process creation can fail because of memory pressure, resource limits, or policy restrictions. Image loading can fail after a parent has successfully created a child. Supervisors therefore distinguish “a process object exists” from “the application has initialized successfully,” often using an explicit readiness protocol rather than treating creation alone as proof that a service is available."
    },
    {
      "heading": "Processor scheduling and context switching",
      "text": "Processes make concurrent activity possible, but processor scheduling determines when their execution streams actually run. On a single processor core, only one ordinary instruction stream executes at a time, even though many activities may appear simultaneous. With multiple cores, several threads can execute at once. This distinguishes concurrency, the organization of overlapping activities, from parallelism, their simultaneous execution on available hardware.\n\nThe scheduler selects runnable threads according to policy. Objectives can include interactive responsiveness, fairness, throughput, energy efficiency, and deadline satisfaction. These objectives can conflict. A long processor allocation may improve efficiency by reducing switching overhead, but it can increase the delay experienced by an interactive task. Priority scheduling favors more urgent work, while time-sharing policies attempt to distribute execution opportunities among competing tasks. Real-time policies place stronger emphasis on predictable timing and specified priorities or deadlines.\n\nA context switch changes the execution context using the processor. The kernel saves state required to resume the outgoing thread and restores corresponding state for the incoming one. Switching between processes may also require changing the active address-space context. Hardware features such as address-space identifiers can reduce the need to discard cached address translations, but details differ across processor architectures. A switch between threads in the same process may avoid an address-space change without eliminating all scheduling costs.\n\nA system call is not itself necessarily a process switch. An application can enter kernel mode, complete a request, and return to the same thread without another thread running. Conversely, a timer interrupt can cause preemption even when the application has not requested a kernel service. A blocking operation, such as reading from a pipe that has no available data, may make the current thread ineligible to run until an event occurs. These distinctions separate privilege transitions, interrupt handling, and scheduling decisions.\n\nSwitching costs include more than saving registers. The incoming activity may encounter cold processor caches, disrupted branch-prediction state, or reduced translation-cache effectiveness. Moving a thread between cores can also affect access to cached data and, on nonuniform-memory-access machines, the cost of reaching physical memory. Processor affinity and placement policies can preserve locality, but overly restrictive placement may leave useful processing capacity idle.\n\nUseful measurements distinguish several kinds of delay. For a simple job model, turnaround time is\n\n\\[T_{\\mathrm{turnaround}} = T_{\\mathrm{completion}} - T_{\\mathrm{arrival}}.\\]\n\nResponse time measures the delay until an initial response, while waiting time usually measures time eligible for execution but not running. A process that consumes little CPU can still have poor response time because it waits for storage, locks, network messages, or a saturated run queue. Process counts alone therefore reveal little about actual processor demand."
    },
    {
      "heading": "Address spaces, memory sharing, and protection",
      "text": "A process’s address space defines the virtual addresses its threads can use and the meanings assigned to those addresses. With virtual memory, the same numeric address in two processes can refer to different physical storage. Page tables and processor protection mechanisms enforce mappings and access permissions. A typical mapping records whether a region is readable, writable, executable, or inaccessible, although the available combinations and enforcement details depend on the hardware and operating system.\n\nThis separation provides fault containment. An invalid memory reference normally causes an exception that the operating system handles on behalf of the offending process, rather than allowing it to overwrite arbitrary memory belonging to another process. It does not guarantee that every programming error is immediately detected: an erroneous write can corrupt a valid location within the same address space. Nor does the boundary protect against kernel defects, incorrectly granted access, or every form of information leakage.\n\nAn address space is not a direct measure of physical-memory consumption. Large regions can be reserved without having physical pages assigned to them. Several processes can map the same read-only executable or library pages. File-backed pages may be recoverable by reading the file again, while modified anonymous pages require different treatment. Measures such as virtual size, resident set size, and proportional set size answer different questions. Adding resident set sizes can count shared physical pages more than once.\n\nCopy-on-write is central to efficient process creation on many Unix-like systems. After fork(), parent and child can initially map the same physical pages with protections that detect writes. When either attempts to modify a shared private page, a fault allows the operating system to establish a separate copy before completing the write. This preserves the appearance of independent memory without immediately copying every page. Page-table work and later write faults still impose costs, so the mechanism does not make creation free.\n\nExplicit shared mappings follow different rules. Changes to a shared memory object can become visible to other processes mapping it, enabling high-throughput communication without copying every message through a kernel buffer. Shared visibility does not by itself provide a correct communication protocol. Programs must still coordinate access and account for the memory hierarchy, compiler transformations, and the processor’s memory-ordering rules. A shared variable used without appropriate synchronization can produce incorrect behavior even when each process is individually protected.\n\nMemory exhaustion also has process-level consequences. Systems may reclaim file-backed pages, move eligible data to backing storage, reject allocations, or terminate selected tasks under severe pressure. Allocation policies differ, including whether an apparently successful reservation guarantees later physical backing. Consequently, a successful address-space allocation is not universally equivalent to a promise that every future access can be satisfied without failure or intervention."
    },
    {
      "heading": "Threads and other units of execution",
      "text": "A process and a thread answer different questions. The process generally identifies a resource and protection environment; the thread identifies a sequential execution stream within it. Threads in one process typically share code, global data, heap storage, and open resources, while maintaining separate stacks and register contexts. An application can therefore perform several activities concurrently without arranging interprocess communication for every exchange of ordinary in-memory data.\n\nThis sharing has both advantages and costs. Creating or switching threads can require less work than establishing fully separate processes, although actual costs depend on the platform and workload. Shared data structures are directly accessible, which can simplify some algorithms and complicate correctness. A corrupted pointer in one thread can damage the entire process. An unhandled fatal fault commonly terminates all threads in that process, whereas separate processes can provide a stronger boundary between components.\n\nKernel-supported threads are visible to the operating-system scheduler. User-level threads, fibers, and similar abstractions are scheduled partly or wholly by a language runtime or library. A many-to-one implementation multiplexes many user-level activities onto one kernel thread; such activities cannot execute simultaneously on multiple cores through that thread alone. One-to-one and many-to-many arrangements offer different trade-offs in scheduling flexibility, blocking behavior, stack management, and runtime overhead.\n\nAn asynchronous task or coroutine is not necessarily a separate thread or process. An event loop can interleave large numbers of tasks in a single thread by suspending each while it awaits an event. This works especially well for workloads dominated by waiting rather than continuous computation. However, code that blocks the event-loop thread can delay unrelated tasks, and CPU-intensive work does not automatically become parallel merely because it is expressed using asynchronous syntax.\n\nLinux illustrates why terminology requires care. Its clone family allows a newly created task to share selected resources with the caller. Tasks that form a conventional process’s thread group share the relevant process environment and are exposed through thread-group conventions. Linux thread identifiers and process identifiers are consequently related but not interchangeable in every interface. Other systems implement the process-thread relationship with different internal structures while presenting similar high-level capabilities.\n\nSome language runtimes use “process” for entities with semantics unlike operating-system processes. Erlang processes, for example, are lightweight runtime-managed activities communicating primarily through messages. Many can exist within one operating-system process, and the runtime schedules them over a smaller set of scheduler threads. Their isolation model is defined largely by the language and runtime rather than by a separate hardware-protected address space for each activity. Such usage reflects the broader idea of an independent computational agent without implying identical implementation."
    },
    {
      "heading": "Communication, synchronization, and coordination failures",
      "text": "Because processes ordinarily have separate address spaces, cooperation requires explicit communication facilities. Interprocess communication includes pipes, local sockets, message queues, shared memory, signals, and higher-level protocols. Some mechanisms transfer byte streams, others preserve message boundaries, and still others expose shared storage. The choice determines how data is framed, how participants discover one another, what happens when a participant fails, and which security checks apply.\n\nA Unix pipeline demonstrates stream-oriented composition. In a command such as producer | consumer, the shell creates a pipe, arranges the processes’ file descriptors, and starts the programs. The consumer reads bytes rather than accessing the producer’s variables. Correct closure of unused pipe ends is significant: a reader normally sees end-of-file only after every reference to the relevant write end has been closed. A mistakenly retained descriptor can therefore make a pipeline appear to hang after the intended producer exits.\n\nSockets support communication both within a machine and across networks. Local-domain sockets can provide local naming, credentials, and, on some systems, transfer of references such as file descriptors. Network sockets allow process interaction across machines through protocols such as TCP. A successful local write to a socket does not necessarily mean that a remote application has processed the data. Application-level acknowledgments and protocols are needed when that distinction matters.\n\nShared memory can reduce data-copying overhead, but it moves coordination into the application’s protocol. Synchronization primitives include mutexes, semaphores, condition variables, and atomic operations, with platform-specific provisions for interprocess use. Protecting a data structure requires more than making individual loads or stores indivisible. Participants must preserve invariants across sequences of operations and establish the ordering needed for one process’s updates to be observed correctly by another.\n\nCoordination can fail through deadlock, starvation, or races. A classic deadlock occurs when process A holds one resource while waiting for another held by process B, which in turn waits for A’s resource. A race occurs when correctness depends on an uncontrolled ordering of events. File-based check-then-act sequences provide a common example: the object tested for permission or existence can change before the later operation uses it. Reliable designs require operations or protocols that preserve the intended relationship between checking and acting.\n\nCommunication channels also impose flow-control behavior. A pipe or socket buffer has finite capacity, so a producer may block or receive a nonblocking failure indication when the consumer cannot keep up. Unbounded queues can postpone visible blocking while increasing memory consumption and latency. Systems therefore use backpressure, bounded queues, cancellation, and explicit failure handling. These issues connect local process coordination with distributed computing, although remote communication adds network partitions, independent machine failures, and uncertainty that local IPC does not always share."
    },
    {
      "heading": "Security boundaries and resource control",
      "text": "Processes are principal units of protection in general-purpose operating systems, but process separation alone is not a complete security policy. Access decisions commonly depend on credentials associated with a process or thread, the permissions of the target object, and additional system policy. Unix-like systems use user and group identities together with mechanisms such as capabilities and mandatory access controls. Windows associates security tokens with execution contexts and checks access against protected objects.\n\nThe boundary can be deliberately crossed through authorized interfaces. Debuggers may inspect or alter another process’s memory, and system administrators may possess broad control over execution. Processes can also inherit sensitive resources accidentally. An inherited descriptor or handle may confer access even when the child could not have opened the underlying object by name. Secure process creation therefore involves controlling credentials, environment variables, inherited objects, and executable selection, not merely starting a separate address space.\n\nA sandbox applies restrictions beyond ordinary process separation. Depending on the system, it may limit available system calls, accessible files, network operations, device access, or interactions with other processes. A web browser can place content rendering in restricted processes while a more privileged broker performs selected operations on their behalf. This reduces the authority directly available to compromised content-handling code, provided that broker protocols and kernel enforcement remain effective.\n\nA container typically groups processes using operating-system isolation and resource-control features rather than assigning a separate kernel to each group. Linux namespaces can provide distinct views of process identifiers, mount points, networking, and other resources, while control groups govern accounting and resource policy. Containers differ from conventional virtual machines, which usually present virtual hardware to a guest operating system. A container boundary consequently depends heavily on the shared host kernel and its configuration.\n\nResource control addresses availability as well as confidentiality and integrity. Process and group limits can restrict CPU consumption, memory, open descriptors, or task creation. These controls help contain runaway workloads and reduce opportunities for a denial-of-service attack. Merely limiting the number of visible processes may be insufficient, since threads, shared resources, and delegated services can consume capacity through different accounting paths. Effective enforcement depends on what the kernel actually measures and charges to the group.\n\nNot all information channels follow intended communication interfaces. Shared caches, timing behavior, and other hardware effects can reveal information across otherwise separate address spaces. Security analysis therefore distinguishes architectural access control from side-channel resistance. Process isolation provides an essential protection mechanism, but the guarantees of a particular deployment depend on hardware, kernel behavior, granted privileges, IPC design, and the larger application’s division of authority."
    },
    {
      "heading": "Application architectures, supervision, and observation",
      "text": "Application designers choose process boundaries to balance isolation, communication cost, memory use, and operational control. A process-per-request server provides straightforward separation but can incur substantial creation and memory overhead. A persistent worker pool amortizes initialization and can bound concurrent work. A multithreaded server shares memory efficiently but places more components within one failure domain. Event-driven servers can manage many connections with relatively few execution threads, often combining this approach with multiple worker processes.\n\nLarge applications frequently mix these models. A browser may use distinct processes for rendering, networking, graphics, and other functions, while each process contains multiple threads. A database management system may use separate processes, multiple threads, or a hybrid arrangement for client sessions, storage work, and background maintenance. The correct unit of concurrency is not determined simply by the number of users or processor cores; it also depends on shared state, blocking behavior, security requirements, and recovery strategy.\n\nSupervision treats processes as managed components rather than merely runnable programs. A supervisor can start workers, observe exit status, enforce restart policies, collect output, and arrange orderly shutdown. Restarting a failed process can restore execution but cannot by itself recover lost in-memory state or undo partially completed external effects. Durable state, transactions, idempotent operations, and explicit recovery protocols determine whether restarting actually restores correct service.\n\nObservation combines several kinds of evidence. Tools such as ps, top, Windows Task Manager, and process explorers report identities, resource usage, and execution state. Linux exposes substantial process information through /proc; other systems offer corresponding query interfaces and tracing facilities. System-call tracing can reveal repeated failed operations or blocked communication. Stack sampling and profilers can identify where execution time is spent, while scheduler tracing can distinguish lack of CPU access from waiting on another resource.\n\nMeasurements require careful interpretation. A process in a sleeping state may be healthy and waiting for work. High CPU utilization can indicate useful throughput or an unintended busy loop. Low CPU utilization does not establish good performance if requests are delayed by storage or locks. CPU percentages can also use different normalization conventions: some tools report utilization relative to one logical CPU, while others normalize across total machine capacity. Memory figures likewise need interpretation in light of shared mappings and reclaimable pages.\n\nProcess identity and observation are time-dependent. A process can exit between enumeration and inspection, and a numeric PID can be reused before a later control operation. Snapshots of multiple processes need not represent one perfectly simultaneous system state. Monitoring systems therefore combine timestamps, stronger process references where available, cumulative counters, and application-level identifiers. These details matter particularly for short-lived workers and automatically restarted services, where repeated instances may share an executable name but represent different lifetimes and different units of work."
    }
  ],
  "links": [
    "operating-system",
    "computer",
    "thread-computing",
    "kernel-operating-system",
    "system-call",
    "unix",
    "bell-labs",
    "posix",
    "linux",
    "concurrent-computing",
    "parallel-computing",
    "cpu-scheduling",
    "cpu-cache",
    "virtual-memory",
    "memory-hierarchy",
    "asynchronous-programming",
    "coroutine",
    "event-loop",
    "interprocess-communication",
    "synchronization-computing",
    "deadlock",
    "distributed-computing",
    "microsoft-windows",
    "sandbox-computer-security",
    "web-browser",
    "virtual-machine",
    "denial-of-service-attack",
    "cybersecurity",
    "database-management-system",
    "database-transaction"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}