Inner entities within a Processes so that you can run parts of a process concurrently. Structure wise, a thread has its own CPU state and acts like a process since we can schedule threads and processes.

If we create and destroy threads for tasks, if there are many tasks and each is short-lived, this could incur overhead. A better way to do this is to use a pool of workers which are created once and only once. The application just submits units of work which are allocated to workers. This will scale based on need and hardware. We can use Amdahl’s law from Parallelism to estimate the number of useful threads.

Rust