# Process

## NAME

process - Process abstraction

## SYNOPSIS

A zircon process is an instance of a program in the traditional
sense: a set of instructions that will be executed by one or more
threads, along with a collection of resources.

## DESCRIPTION

The process object is a container of the following resources:

- [Handles](https://fuchsia.dev/docs/concepts/kernel/handles)
- [Virtual Memory Address Regions](https://fuchsia.dev/fuchsia-src/reference/kernel_objects/vm_address_region)
- [Threads](https://fuchsia.dev/fuchsia-src/reference/kernel_objects/thread)

In general, it is associated with code, which it is executing until it is
forcefully terminated or the program exits.

Processes are owned by [jobs](https://fuchsia.dev/fuchsia-src/reference/kernel_objects/job) and allow an application that is
composed by more than one process to be treated as a single entity, from the
perspective of resource and permission limits, as well as lifetime control.

For more information, see [Processes Overview](https://fuchsia.dev/docs/concepts/process/overview).

### Lifetime

A process is created via [`zx_process_create()`](https://fuchsia.dev/reference/syscalls/process_create) and its execution begins with
[`zx_process_start()`](https://fuchsia.dev/reference/syscalls/process_start).

The process stops execution when:

- the last thread is terminated or exits
- the process calls [`zx_process_exit()`](https://fuchsia.dev/reference/syscalls/process_exit)
- the parent job terminates the process
- the parent job is destroyed

The call to [`zx_process_start()`](https://fuchsia.dev/reference/syscalls/process_start) cannot be issued twice. New threads cannot
be added to a process that was started and then its last thread has exited.

## SYSCALLS

- [`zx_process_create()`](https://fuchsia.dev/reference/syscalls/process_create) - create a new process within a job
- [`zx_process_read_memory()`](https://fuchsia.dev/reference/syscalls/process_read_memory) - read from a process's address space
- [`zx_process_start()`](https://fuchsia.dev/reference/syscalls/process_start) - cause a new process to start executing
- [`zx_process_write_memory()`](https://fuchsia.dev/reference/syscalls/process_write_memory) - write to a process's address space
- [`zx_process_exit()`](https://fuchsia.dev/reference/syscalls/process_exit) - exit the current process

<br />

- [`zx_job_create()`](https://fuchsia.dev/reference/syscalls/job_create) - create a new job within a parent job

<br />

- [`zx_task_create_exception_channel()`](https://fuchsia.dev/reference/syscalls/task_create_exception_channel) - listen for task exceptions

<br />

- [`zx_vmar_map()`](https://fuchsia.dev/reference/syscalls/vmar_map) - Map memory into an address space range
- [`zx_vmar_protect()`](https://fuchsia.dev/reference/syscalls/vmar_protect) - Change permissions on an address space range
- [`zx_vmar_unmap()`](https://fuchsia.dev/reference/syscalls/vmar_unmap) - Unmap memory from an address space range

[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/reference/kernel_objects/process.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/reference/kernel_objects/process.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/kernel_objects/process.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/reference/kernel_objects/process.md "Edit the source code of this page")