Threads and processes
A process is a program that is running; a thread is a single line of execution inside it. Everything the system does happens inside some thread, which makes processes and threads the actors the rest of Peios is built to reason about. This page introduces what they are; the topic goes on to cover how they are created, how they end, and how they relate.
ConceptA thread is the basic unit of work — a single line of execution the system runs. A process is the boundary around one or more threads, holding the memory, open resources, and identity they share. This page explains how the two relate, and why a thread is the more fundamental of the two.
ConceptNew programs come to run through two basic moves — a process can split into a copy of itself, and a process can replace the program it is running with a different one. This page covers how processes are created, what a new one starts with, and how to get a reliable handle to it.
ConceptEvery process is created, runs for a while, and then ends. This page covers how a process ends, how its result is collected, what happens when its parent ends first, and how the system cleans up after it.
ConceptProcesses are related to one another in two ways — by descent, forming a family tree from the first process down, and by grouping, which bundles related processes so they can be controlled together at a terminal. This page covers both, and clears up a name collision — a job-control session is not a logon session.
ConceptThe Process Security Block (PSB) is the per-process bundle recording what a process is — how trusted its program is, how it is hardened, and who may operate on it — as distinct from who it is acting as, which is the token. This page introduces the PSB and points to the topics that own each part.
referenceThe precise contract for the process- and thread-creation calls — fork, vfork, clone, clone3, the clone sharing flags, and the exec family. For the conceptual picture see Creating processes; this page is the exact detail a program is written against.
referenceThe precise contract for ending a process and collecting its result — exit, _exit and exit_group, the encoding of an exit status, and the wait family (wait, waitpid, waitid, wait4). For the conceptual picture see Process lifecycle.
referenceThe per-thread operations a program uses directly — reading a thread's ID, the exit-notification mechanism behind thread joins, and thread-local storage. The thread-level companion to the process and thread model.