In sched.h, task_struct has following 2 fields: thread_group & thread_node. They keep the first element of their list but I could not find which type of variables they contain.
1511 struct task_struct { .... 1657 /* PID/PID hash table linkage. */ 1658 struct pid_link pids[PIDTYPE_MAX]; 1659 struct list_head thread_group; 1660 struct list_head thread_node; .... }
Advertisement
Answer
thread_group
and thread_node
are both intrusive linked-lists of all the threads in a thread group – they are use to link together task_struct
s, they don’t “contain” anything.
The difference between the two is that thread_group
has its head in the task_struct
of the thread group leader, whereas thread_node
has its head in the signal_struct
shared by the thread group. In the medium-term thread_group
is going away.