◄ Wiki / OS
PID / TID
Unique ID numbers the operating system assigns to each running program (PID) and each thread inside it (TID).
A process ID identifies a whole running program; a thread ID identifies one line of execution within that program, since a single process can run many threads at once. The OS must hand these out uniquely, and 'atomic PID/TID allocation' means the counter that issues them is protected so two cores can never accidentally receive the same number at the same instant.
See also
- preemption / preemptiveWhen the OS forcibly pauses a running thread mid-execution to let a different one run.
- reaperA background kernel thread that cleans up threads that have finished, freeing their resources.
- race / race conditionA bug where the outcome depends on the unpredictable timing of two things happening at once.