Re: [PATCH] 2.4.9 Make thread group id visible in /proc/<pid>/status

From: Dave McCracken (dmccr@us.ibm.com)
Date: Mon Aug 20 2001 - 14:30:52 EST


--On Monday, August 20, 2001 19:09:16 +0000 Miquel van Smoorenburg
<miquels@cistron-office.nl> wrote:

> Hmm, I've always been a bit curious about this .. I don't think getpid()
> should return tgid instead of pid. It looks broken to me. Thread groups
> are a good idea, but they should act more like process groups do.
> Switching pid and tgid is something that the LinuxThreads library
> should probably do, but not the kernel. IMHO.
>
> If one really wants CLONE_PID to work, fix CLONE_PID.

I wasn't on the list when getpid() was changed to return tgid. I don't
have a strong feeling about it, though it does make pthread semantics
simpler.

CLONE_PID really isn't the semantic we want, though. That would make all
tasks in the process have the same pid, and no way to address a specific
task. We'd have to introduce something like a task id or a thread id.
Having tgid and pid gives us the tools we need, and minimizes the
compatibility issues.

Dave McCracken

======================================================================
Dave McCracken IBM Linux Base Kernel Team 1-512-838-3059
dmccr@us.ibm.com T/L 678-3059

-
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/



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:37 EST