Linux thread is an execution branch within the process, and the thread magnitude is very small. All processes have at least one thread. Resources shared by threads: 1. User ID and group ID; 2. Current working directory; 3. The same address space; 4. The processing method of each signal.
The definition of thread
(Recommended learning: linux tutorial)
Thread is inside the process An execution branch, the thread size is very small (the so-called internal means running in the address space of the process).
All processes have at least one thread.
Thread-shared resources
The same address space
File descriptor table ()
The processing method of each signal (such as: SIG_DFL, SIG_IGN or customized signal priority)
Current working directory
User id and group id
Thread-independent resources
The thread will generate temporary variables, and the temporary variables are saved on the stack, so Each thread has its own private stack structure
Each thread has private context information.
Thread ID
The value of a set of registers
errno variable
Signal masking words and scheduling priority
The above is the detailed content of What does linux thread mean?. For more information, please follow other related articles on the PHP Chinese website!