I need, for a given thread group, to get each of its member threads sequential index to store some data about each thread from inside of the kernel, I have access to task_struct
. Something like “0th thread was created first, 1st thread is created second, …” would work fine.
One way to distinct threads from one thread group is obviously refer to their process ids, however, process ids are not sequential, while I want to get some sort of identificators that are sequentially ordered one after another (indexes).