Threads
Linux does not have threads. Linux treats threads as processes, which means that threads are processes that share the memory address space. If a process has two threads, it means two processes are sharing resources.
Threads are created by the clone system call with the following flags: Running state: In this state, the process is in a runnable state or in a run queue, waiting to run. The TASK_ RUNNING flag is used for this state. Interruptible state: Here, the process is in sleep mode and waiting for some task to finish, but it can also be invoked prematurely by a signal. The TASK_INTERRUPTIBLE flag is used for this state. Uninterruptible state: The process is in sleep mode and waiting for some task to finish but it cannot be invoked prematurely by a signal. The TASK_ UNINTERRUPTIBLE flag is used for this state. So processes can be in the running, waiting or stopped state. There is one more state – the zombie state - which will be described later.