OpenSource For You

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. Interrupti­ble state: Here, the process is in sleep mode and waiting for some task to finish, but it can also be invoked prematurel­y by a signal. The TASK_INTERRUPTI­BLE flag is used for this state. Uninterrup­tible state: The process is in sleep mode and waiting for some task to finish but it cannot be invoked prematurel­y by a signal. The TASK_ UNINTERRUP­TIBLE 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.

Newspapers in English

Newspapers from India