Why not put threads belonging to a thread group into /proc/17072/threads ?
> $ ls -a /proc
I'm seeing 17072 as a group-leader and the 'threads' as .17073 etc.
When you put all 'threads' into /proc/17072/threads, you'd get
/proc/17072/threads/17072, /proc/17072/threads/17073, etc.
/proc/17072 would show stats for the whole threads group, while
/proc/17072/threads/17072 would show stats for just that thread.
>the .17073 ... .17082 entries belong to the thread-group 17072.
Yuck ;(
>The key here is for procps to be able to parse threads without having to
>call into the kernel 16K times. The dot-approach also has the added
>benefit of 'hiding' threads in the default 'ls /proc' listing.
What is against /proc/<pid>/threads ?
>the other change needed was the ability to read comulative CPU usage
>statistics from the thread group leader. I've introduced 4 new fields in
>/proc/PID/stat for that purpose, the kernel keeps those uptodate across
>fork/exit and in the timer interrupt - it's very low-overhead.
That would also be solved with /proc/<pid> and /proc/<pid>/threads/<thread>
>another advantage of this approach is that old procps is fully compatible
>with the new kernel, and new procps is fully compatible with old kernels.
That would also be the case with /proc/<pid>/threads
Mike.
-- Anyone who is capable of getting themselves made President should on no account be allowed to do the job -- Douglas Adams.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/