Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

what is the purpose of tasks member of 'struct pid' defined in Linux/include/linux/pid.h?

$
0
0

Im trying to understand better how the kernel implement pid namespace .One of the basic structure that is being used is struct pid :

struct pid {       atomic_t count;      unsigned int level;      /* lists of tasks that use this pid */      struct hlist_head tasks[PIDTYPE_MAX];      struct rcu_head rcu;      struct upid numbers[1]; }

Now from what I understand numbers array keeps track of the process different pids in different pid namespaces.

What I dont understand is the purpose of tasks member.It says here: (LWN) :

.." This structure contains the ID value, the list of tasks having this ID.."

So I understand from this that the same pid is shared between couple of proccess/tasks .Now, different proccess/threads can share same tpid/gpid but not the same pid!So how come there are list of tasks having the same PID? What am I missing?

Thanks


Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>