Thread


In programming, a thread refers to the smallest sequence of instructions that can be scheduled and executed by an operating system. A thread is also known as a lightweight process and is part of a larger process.

Threads allow a program to perform multiple tasks at the same time, which is known as concurrency. Each thread has its own stack and executes independently, but they share the same memory space and resources of the process they belong to.

In multi-threaded programming, multiple threads can run simultaneously, with each thread performing its own task. For example, in a web server, a single process may have multiple threads that handle different incoming requests concurrently.

Threads can be created and managed by the programming language or by the operating system itself, depending on the programming model used.

META

Status:: #wiki/notes/mature
Plantations:: Programming
References:: ILOG