What is task struct or process descriptor? and task_list ?

In Linux, a "task struct", also known as a process descriptor, represents a running process or a thread.
A "task struct" also referred as a process descriptor, is defined in the Linux kernel source code as a "C structure" named task_struct.
 
It holds a wide range of fields that holds all relevant and specific details of a process (or thread), in other words it represents a running process or a thread. 

Typically it is a data structure used by the kernel to keep track of various details related to a process (or thread), such as its state, priority, virtual memory layout, open file descriptors, signal handlers, and more. This provides to kernel with all the necessary details to manage and schedule processes effectively.

And, the mapping between a userspace thread and a kernel¬space task_struct is 1:1.
 
All task_struct's, i.e., all process descriptors, , are formed using a linked list, ie using a circular doubly¬linked list works best and this list is referred the “task list”. it is  built¬in to the mainline kernel in a header called “list.h” has the data structure.

Previous Post Next Post

Contact Form