Re: same pid ?
ratheesh k <[email protected]> Fri, 11 Feb 2011 07:48:35 +0530
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
>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. -ratheesh On Fri, Feb 11, 2011 at 4:56 AM, Jonathan Isom <[email protected]> wrote: > On Thu, Feb 10, 2011 at 12:09 PM, ratheesh k <[email protected]> wrote: >> 2011/2/10 Michal Nazarewicz <[email protected]>: >>> On Thu, 10 Feb 2011 12:37:25 +0100, ratheesh k <[email protected]> >>> wrote: >>>> >>>> i created two threads with pthread library. But both threads returns >>>> same pid with getpid() function. ??? >>> >>> PID is a Process ID. All threads in given process have the same PID. >>> >> >> pthread uses clone system call. doen't it ? if so, please see - man clone >> >> >> CLONE_PID (obsolete) >> If CLONE_PID is set, the child process is created with the same >> process ID as the calling process. This is good for hacking the >> system, but otherwise of not much use. Since 2.3.21 this flag >> can be specified only by the system boot process (PID 0). It >> disappeared in Linux 2.5.16. >> >> > > Newer distros use Native POSIX Thread Library (NPTL). They return the same pid. > > >> >> >> >> >> >>> -- >>> Best regards, _ _ >>> .o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o >>> ..o | Computer Science, Michal "mina86" Nazarewicz (o o) >>> ooo +-<email/jid: [email protected]>--------ooO--(_)--Ooo-- >>> >> -- >> 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 >> > > > > -- > ASUS M4A78 PRO motherboard > Athlon II X4 640 Processor > 4 Gigabytes of DDR2-800 > Galaxy GTX 465 Graphics adapter > KWorld ATSC 110 TV Capture Card > KWorld ATSC 115 TV Capture Card > -- 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