Re: same pid ?

Steve Graegert (スティーブ) <[email protected]> Fri, 11 Feb 2011 06:12:06 +0100
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
On Fri, Feb 11, 2011 at 03:18, ratheesh k <[email protected]> wrote:
>>On Fri, Feb 11, 2011 at 4:56 AM, Jonathan Isom <[email protected]> wrote:
>> Newer distros use Native POSIX Thread Library (NPTL).  They return the same pid.
>
> if linux treats every thing as task (both thread and process ) and
> CLONE_PID flag is obsolete, i expected unique pid.

POSIX.1 requires threads to share a couple of attributes (mainly
process attributes) like the process ID, open FDs and many others.
What you are referring to ("everything as task") is the fact that each
thread is associated with a single scheduling entity within the kernel
implementing a 1:1 mapping.  Yet, threads created within the same
process share a single PID.

You are advised to consult pthreads(7) to make yourself familiar with the topic.

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html