Thread
A thread is a sequence of instructions that runs within a process and shares its memory with the process's other threads.
A thread is the smallest unit of work that an operating system schedules on a CPU core. Every process has at least one thread, and many have several. Threads in one process share its memory and open files, but each has its own registers and stack. The kernel switches cores between threads many times a second.
Threads let one program do several things at once. On a machine with many cores, threads can run truly in parallel and finish work faster. Because they share memory, they can exchange data cheaply but can also interfere with each other. Bugs from two threads changing the same data at once are among the hardest to find.
The vCPUs of a sandbox are threads on its host, scheduled like any other. Inside a sandbox, programs create their own threads on the vCPUs they are given. A program that starts more busy threads than it has vCPUs only makes them wait in turn. The CPU limit of a sandbox therefore caps how much parallel work it can do, whatever its thread count.
Related terms