blob: dff41d15da90acb4066975870d8357591df4ffbf [file] [log] [blame] [view]
# Process
process - Process abstraction
A zircon process is an instance of a program in the traditional
sense: a set of instructions which will be executed by one or more
threads, along with a collection of resources.
The process object is a container of the following resources:
+ [Handles](/docs/concepts/kernel/
+ [Virtual Memory Address Regions](
+ [Threads](
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]( 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.
### Lifetime
A process is created via [`zx_process_create()`] and its execution begins with
The process stops execution when:
+ the last thread is terminated or exits
+ the process calls [`zx_process_exit()`]
+ the parent job terminates the process
+ the parent job is destroyed
The call to [`zx_process_start()`] cannot be issued twice. New threads cannot
be added to a process that was started and then its last thread has exited.
- [`zx_process_create()`] - create a new process within a job
- [`zx_process_read_memory()`] - read from a process's address space
- [`zx_process_start()`] - cause a new process to start executing
- [`zx_process_write_memory()`] - write to a process's address space
- [`zx_process_exit()`] - exit the current process
- [`zx_job_create()`] - create a new job within a parent job
- [`zx_task_create_exception_channel()`] - listen for task exceptions
- [`zx_vmar_map()`] - Map memory into an address space range
- [`zx_vmar_protect()`] - Change permissions on an address space range
- [`zx_vmar_unmap()`] - Unmap memory from an address space range
[`zx_job_create()`]: /docs/reference/syscalls/
[`zx_process_create()`]: /docs/reference/syscalls/
[`zx_process_exit()`]: /docs/reference/syscalls/
[`zx_process_read_memory()`]: /docs/reference/syscalls/
[`zx_process_start()`]: /docs/reference/syscalls/
[`zx_process_write_memory()`]: /docs/reference/syscalls/
[`zx_task_create_exception_channel()`]: /docs/reference/syscalls/
[`zx_vmar_map()`]: /docs/reference/syscalls/
[`zx_vmar_protect()`]: /docs/reference/syscalls/
[`zx_vmar_unmap()`]: /docs/reference/syscalls/