Concepts

CONCEPTSREVIEWED: 2026-08-07

Every concept the corpus teaches, with the pages that teach it. Concepts cut across sections: the same idea shows up in the R runtime, in the operating system, and in my projects. Use this page when you know the idea you want and not the section it lives in.

ABI

Application binary interface: the binary-level agreement between separately compiled code, covering the calling convention, the size and alignment of types, the layout of structs passed between them, and the names of exported symbols. Code compiled against one build runs against another only if the two agree on all of these. Full entry

CPU affinity

A restriction that lets a thread or process run only on a chosen set of cores, set with sched_setaffinity() on Linux or SetThreadAffinityMask() on Windows. Full entry

alignment

The requirement that a value of a given type sit at an address that is a multiple of that type’s alignment. For small scalars the alignment is usually the type’s size, and a struct takes the strictest alignment of its members. Full entry

ALTREP

R’s framework for alternative vector representations, added in R 3.5.0: a class supplies methods for length, element access and the data pointer, so a vector such as the compact sequence 1:1e9 can exist without its elements stored in memory. Full entry

Amdahl's law

If a fraction s of a program’s run time is serial, its speedup on n workers is at most 1 / (s + (1 - s) / n), which approaches 1 / s however many workers are added. Full entry

apartment model

A design in which several interpreters run in one process, each owned by one thread and holding its own heap, garbage collector and global state, so no mutable R object is shared between them. Full entry

arena

A region of memory from which an allocator hands out space by bumping a pointer, and which is freed all at once instead of object by object. Full entry

AST

Abstract syntax tree: a tree that records the structure of parsed code (calls, arguments, operators) and drops surface detail such as whitespace. In R the parser’s output is itself R data: calls are language objects that R code can inspect and build. Full entry

atomic

Describes an operation that other threads see either completely done or not started, never half done. CPUs provide atomic loads, stores and read-modify-write instructions such as fetch-and-add and compare-and-swap. Full entry

atomic vector

A vector whose elements all have one type: logical, integer, double, complex, character or raw. The elements sit in one contiguous block, except that a character vector holds pointers to shared CHARSXP strings, not the text itself. Full entry

backpressure

Slowing or blocking a producer when its consumer falls behind, so a queue between them does not grow without bound. Full entry

benchmark

A timed, repeatable measurement of a program under stated conditions (machine, inputs, number of runs), reported with its spread instead of as a single number. Full entry

BLAS

Basic Linear Algebra Subprograms: a standard interface for vector and matrix operations such as matrix multiply. R ships a single-threaded reference BLAS and can be linked against optimized ones, such as OpenBLAS, Intel MKL or Apple Accelerate, which usually run on several threads. Full entry

borrow

In Rust, a reference to a value that does not take ownership of it. The compiler allows either many shared borrows or one mutable borrow at a time, and rejects any borrow that could outlive the value. Full entry

branch prediction

The CPU’s guess at the direction of a conditional branch or the target of an indirect jump, so it can keep fetching instructions before the outcome is known. A wrong guess throws away the work done on the wrong path. Full entry

bytecode

A compact instruction format for a virtual machine, at a level between source code and machine code. R’s compiler package compiles closures to bytecode, which R’s bytecode interpreter runs. Full entry

cache coherence

The hardware guarantee that the cores’ caches agree on the value of each memory location: a write by one core becomes visible to the others, and all cores see the writes to one location in the same order. Protocols such as MESI provide it by invalidating other cores’ copies of a cache line before a core writes to it. Full entry

cache line

The block of memory, usually 64 bytes on x86-64 and 128 bytes on Apple M-series chips, that the CPU moves between main memory and its caches as one unit. Full entry

calling convention

The part of an ABI that fixes how a function call works in machine code: which registers or stack slots carry the arguments and the return value, which registers the called function must preserve, and who cleans up the stack. Full entry

channel

A queue that carries values from one thread or task to another, so they communicate by sending messages instead of sharing memory. A bounded channel blocks the sender when it is full. Full entry

closure

A function together with the environment it was created in. Calling a closure evaluates its body in a new environment whose enclosing environment is the captured one, which is how the body sees variables from where the function was defined. Full entry

compare-and-swap

An atomic instruction that writes a new value to a memory location only if the location still holds an expected value, and reports whether it did. It is the usual building block of lock-free data structures. Full entry

compatibility

The degree to which code built for one version of a system keeps working with another, at three levels: source (it still compiles), binary (compiled code still loads and runs, the ABI) and behavior (it still computes the same results). Full entry

concurrency

Structuring a program as several tasks whose executions overlap in time, whether they take turns on one core or run at once on several. Parallelism is the case where they run at the same instant. Full entry

condition

An R object, a list of class condition holding a message and a call, that stop(), warning(), message() or signalCondition() signals to the handlers that are currently established. Full entry

condition variable

A synchronization primitive that lets a thread sleep until another thread signals that some condition may now hold. It is always used with a mutex, and the waiting thread rechecks the condition after waking, because wakeups can be spurious. Full entry

context switch

The OS saving one thread’s CPU state and restoring another’s on the same core. A switch to a thread of a different process also changes the address space. Full entry

copy-on-write

The kernel technique that lets two processes share physical pages after fork() until one of them writes to a page; the write faults, and the kernel gives the writer its own copy of that page. Full entry

copy-on-modify

R’s value semantics: an assignment binds another name to the same object, and a later modification copies the object first if anything else still refers to it. The copy happens when the object is modified, not when it is assigned. Full entry

data race

Two threads access the same memory location, at least one of the accesses is a write, and nothing orders the two. In C, C++ and Rust a data race is undefined behavior. Full entry

deadlock

A state in which each thread in a group waits for something another member holds, so none of them can proceed. With locks it usually comes from two threads acquiring the same locks in different orders. Full entry

deoptimization

Abandoning optimized compiled code and resuming in a slower general version, usually the interpreter, when an assumption the compiler relied on turns out false. Full entry

deque

A double-ended queue: items can be added and removed at both ends. Full entry

dynamic linking

Resolving a program’s references to functions and variables in shared libraries when the library is loaded or first used, instead of copying the code into the program when it is built. Full entry

embarrassingly parallel

Work that splits into independent tasks that share no state and do not communicate until their results are collected. Full entry

environment

An R object that holds a frame of name-to-value bindings and a pointer to an enclosing environment. Looking up a name searches the frame, then each enclosing environment in turn. Full entry

evaluation

Computing the value of an R expression in an environment: a constant evaluates to itself, a symbol to the value bound to it, and a call to the result of applying its function to its arguments. Full entry

external pointer

An R object (EXTPTRSXP) that holds a C pointer to memory or a resource R does not manage, together with a tag and a protected R value. A finalizer can release the resource when the object is collected. Full entry

FFI

Foreign function interface: the mechanism by which code in one language calls code in another. In R it is .Call(), .External(), .C() and .Fortran() on the R side and the C API on the native side. Full entry

file descriptor

A small integer that indexes a process’s table of open files, sockets and pipes. Full entry

finalizer

A function that runs after the garbage collector finds an object unreachable, used to release resources other than memory, such as file handles or connections. Full entry

fork

The POSIX call that creates a child process as a copy of the calling one: the same memory image (shared copy-on-write), the same open file descriptors, but only the thread that called fork(). Full entry

fragmentation

Free memory broken into pieces too small for the allocation at hand, so a request fails or the heap grows even though enough free memory exists in total. Full entry

garbage collection (GC)

Automatic memory management that finds the objects no longer reachable from any root and frees them. R’s collector is a non-moving, generational mark-and-sweep collector. Full entry

garbage collection pause

The time a program stops running its own code while the garbage collector works. R’s collector runs on the thread that triggered it, and evaluation waits until the collection finishes. Full entry

GC root

A reference the garbage collector treats as live without tracing to it; marking starts from the roots. In R the roots include the global and base environments, the symbol table, the PROTECT stack and the precious list, but not the C stack. Full entry

hardware thread

One instruction stream a core can run at a time. A core with simultaneous multithreading (Intel calls it Hyper-Threading) usually runs two, sometimes more, which share that core’s execution units and caches. Full entry

heap

The memory a program allocates at run time for objects whose size or lifetime is not known when the code is compiled. In a garbage-collected runtime, the collector frees heap objects that are no longer reachable. Full entry

immortal object

An object that exists for the whole life of the process and that the runtime never frees, counts or marks, so reading it writes nothing. CPython adopted immortal objects in PEP 683. Full entry

interpreter

A program that runs code by evaluating a parsed or bytecode form of it, without first translating the whole program to machine code. In this book an interpreter also means one running instance of R with its own state (global environment, heap, symbol table, call stack); GNU R runs one per process. Full entry

isolation

The property that one execution context cannot read or corrupt another’s memory or state except through an explicit channel. Full entry

JIT compilation

Just-in-time compilation: compiling code while the program runs, usually to machine code, so the compiler can use what it observes at run time. R’s JIT, on by default since R 3.4.0, compiles closures and top-level loops to R bytecode, not to machine code. Full entry

latency

The time from starting one task, or sending one request, to getting its result. Throughput counts results per unit of time instead. Full entry

lazy evaluation

Delaying the evaluation of an expression until its value is first needed. R passes function arguments lazily, as promises. Full entry

lifetime

In Rust, the region of code for which a reference is valid. Every reference has one, usually inferred or elided instead of written as 'a, and the compiler rejects any reference that could outlive the value it points to. Full entry

livelock

Threads keep running and reacting to each other but make no progress. Unlike in a deadlock, nothing is blocked. Full entry

load balancing

Distributing work among workers so that none sits idle while others still have work to do. Full entry

lock-free

A synchronization strategy built on atomic operations such as compare-and-swap, where the system as a whole is guaranteed to make progress no matter how any individual thread is delayed. Individual threads can still spin and retry. Full entry

memory bandwidth

The rate, in bytes per second, at which the memory system can move data between RAM and the cores. Full entry

memory ordering

The rules for which reorderings of memory operations the compiler and CPU may make, as other threads see them. Each atomic operation carries an ordering, such as relaxed, acquire, release or sequentially consistent, that limits those reorderings. Full entry

memory safety

Freedom from bugs that access memory incorrectly: use after free, out-of-bounds access, reads of uninitialized memory and data races. Safe Rust rules them out, mostly at compile time and with bounds checks at run time. Full entry

memory mapping

Mapping a file, or an anonymous region, into a process’s address space with mmap(), so ordinary loads and stores read and write it. With MAP_SHARED, processes that map the same region see each other’s writes; a MAP_PRIVATE mapping is copy-on-write. Full entry

mutex

A lock that lets one thread at a time into a protected section of code. A thread that tries to acquire a held mutex waits until the holder releases it. Full entry

NAMED

The named field in an R object’s header. Before R 4.0.0 it held a capped count of bindings that told R whether an object could be modified in place; since R 4.0.0 it holds the object’s reference count, and the NAMED() macro reads that count. Full entry

namespace

The environment that holds a package’s own functions and variables, with an imports environment above it and the base namespace above that. Code that attaches or imports the package sees only the names the namespace exports. Full entry

native package

An R package with compiled C, C++ or Fortran code in its src/ directory, which R calls through .Call() or another foreign function interface and which reaches back into R through the C API. Full entry

object identity

Whether two references name the same object in memory, as opposed to two objects with equal values. identical() compares values for most R objects and identity only for environments and other reference objects. Full entry

oversubscription

Running more busy threads than the machine has hardware threads, so they take turns and lose time to context switches and cache misses. Full entry

ownership

Rust’s rule that each value has exactly one owner, which frees it when the owner goes out of scope. Assigning or passing a value moves ownership unless its type is Copy. Full entry

page

The fixed-size block of virtual memory that the OS maps and protects as a unit, usually 4 KiB on x86-64 and 16 KiB on Apple silicon Macs. Full entry

page fault

The trap taken when a memory access cannot be satisfied by the current page mapping. That covers a page with no physical frame behind it, and also a write to a page marked read-only, which is how copy-on-write is implemented. Full entry

pairlist

R’s linked list of cons cells (LISTSXP), each holding a value, a tag (a name) and a pointer to the next cell. R uses it for function formals and attribute lists and, as LANGSXP, for calls; the value of ... is a pairlist of type DOTSXP. Full entry

parallel efficiency

Speedup divided by the number of workers: the fraction of each added worker’s capacity that turns into progress. Full entry

parallelism

Several computations executing at the same instant on different cores or processors. Concurrency only requires that their executions overlap in time. Full entry

parser

The stage that turns a stream of tokens into an AST according to the language’s grammar. R’s parser is generated by bison from src/main/gram.y. Full entry

pipe

A one-way byte stream between two file descriptors, usually connecting a parent process and its child. Full entry

process

A running program with its own address space, its own table of open file descriptors and one or more threads. Processes share no memory unless they map shared memory explicitly. Full entry

profiling

Measuring where a program spends time or memory, before deciding what to optimize. Full entry

promise

The R object (PROMSXP) that holds an unevaluated argument: its expression, the environment to evaluate it in and, once forced, its value. Forcing a promise evaluates it once and caches the result. Full entry

PROTECT stack

R’s stack of objects that C code has marked as in use with PROTECT(); the garbage collector treats every entry as a root. UNPROTECT(n) pops the top n entries, so protection has to nest like a stack. Full entry

race condition

A bug in which the result depends on the timing of events that nothing orders, such as two workers each checking that a file is missing and then creating it. A data race is related but not the same: it is a property of single memory accesses, and it may or may not make the program’s result depend on timing. Full entry

reference counting

Tracking how many references point to an object and freeing it when the count reaches zero. On its own it cannot free a cycle of objects that refer to each other. Full entry

resident set size

The physical memory a process occupies right now, counting every resident page it maps, shared pages included. Summing it across forked workers counts each shared page once per worker. Full entry

RNG stream

An independent sequence of random numbers assigned to one task, so its draws do not depend on which worker runs it or in what order. Full entry

runtime

Everything a program needs while it runs beyond its own code: memory management, the evaluator or virtual machine, and the builtin libraries. R’s runtime includes the evaluator, the garbage collector, the symbol table and the base functions written in C. Full entry

scaling

How performance changes as workers are added. Strong scaling keeps the problem size fixed; weak scaling grows the problem in proportion to the number of workers. Full entry

scheduler

The component that decides which runnable thread or task runs next, and where. The OS scheduler places threads on cores; a runtime scheduler places tasks on worker threads or processes. Full entry

semaphore

A counter with two atomic operations: wait, which decrements it and blocks while it is zero, and post, which increments it and wakes a waiter. A semaphore that starts at N lets at most N holders through at once. Full entry

serialization

Encoding an object graph as a sequence of bytes that can be stored or sent elsewhere; deserialization rebuilds an equal graph from the bytes. In R these are serialize() and unserialize(), and saveRDS() writes the same format, compressed by default, to a file. Full entry

serialization format

The byte layout a serializer writes. R’s format has XDR binary (the default), native binary and ASCII variants, and a version number. Full entry

SEXP

The C type through which C code handles every R object: a pointer to a SEXPREC, the node that holds the object’s header and data. Packages see only the pointer and the accessor functions, never the struct. Full entry

SEXPTYPE

The type code stored in a SEXPREC header, such as INTSXP, REALSXP, STRSXP, VECSXP or CLOSXP. TYPEOF(x) returns it in C, and typeof() reports its name in R. Full entry

shared memory

Memory that several threads, or several processes through a shared mapping, can read and write directly. A write that can happen at the same time as another access to the same location needs synchronization. Full entry

signal

A notification the OS delivers to a process, such as SIGINT for Ctrl-C, SIGCHLD when a child exits or SIGSEGV for an invalid memory access. Its handler interrupts whichever thread receives it, at any instruction. Full entry

SIMD

Single instruction, multiple data: one CPU instruction applied to several values at once, such as adding four doubles with one AVX instruction. Full entry

socket

An endpoint for communication over a network protocol, between processes on one machine or on different machines. Full entry

spawn

Starting a worker as a fresh process that does not copy the parent’s memory, unlike fork. It is not a blank slate: it receives an environment, a working directory, and any handles or descriptors the parent passes on. Full entry

speedup

Sequential run time divided by parallel run time for the same work. The number means little without its baseline: speedup over a slow sequential version overstates what parallelism gained. Full entry

spinning

Waiting by checking a condition in a loop instead of sleeping. It reacts fastest when the wait is short and keeps a core busy for as long as the wait lasts. Full entry

  • Mutexes Concurrency / Intermediate

starvation

A thread or task that stays ready to run but rarely or never gets to, because others keep winning the scheduler or the lock. Full entry

symbol

An R name (SYMSXP), interned so that each name exists once and comparing two names compares two pointers. install() in C and as.name() in R return the unique symbol for a string. Full entry

symbol registration

Declaring a package’s native entry points to R at load time, by calling R_registerRoutines() from the package’s R_init_<pkg>() function, so .Call() finds them in R’s table of registered routines instead of looking each name up in the shared library. Full entry

system call

A transition from user code into the kernel. A system call is not by itself a context switch, and one that is satisfied without blocking usually returns to the same thread. Full entry

task granularity

How much work one task carries. Tasks that are too small let dispatch and synchronization overhead dominate; tasks that are too large leave workers idle while the last few finish. Full entry

thread

The unit of execution the OS schedules: an instruction stream with its own stack and registers. Threads in one process share its memory and open files. Full entry

thread pool

A fixed set of worker threads that take tasks from a queue, so a program pays for creating threads once instead of once per task. Full entry

throughput

Tasks completed per unit of time. Latency is the time one task takes. Full entry

thread-local storage (TLS)

Variables of which each thread has its own instance, declared with _Thread_local in C11, __thread in GCC or thread_local! in Rust. Full entry

unwinding

Leaving a chain of active function calls early, after an error or another non-local exit, and running each frame’s cleanup code on the way out. Full entry

virtual memory

The hardware and OS mechanism that gives each process its own address space and maps its pages, through page tables, to physical memory or to disk. Full entry

work queue

A thread-safe queue of tasks that workers take from. One shared queue is simple and contended; per-worker queues avoid the contention and need work stealing to stay balanced. Full entry

work stealing

A load-balancing strategy in which each worker has its own deque of tasks and an idle worker takes queued, not yet started tasks from the far end of a busy worker’s deque. It never takes work already running, and because owner and thief use opposite ends, they rarely contend. Full entry

write barrier

Code the runtime runs on every store of a reference into an object, so the garbage collector’s invariants survive the store. In a generational collector it records old-to-young references, which lets a young collection skip the old generation. Full entry

Back to top