On Thu, Feb 10, 2011 at 12:09 PM, ratheesh k <ratheesh.ksz@xxxxxxxxx> wrote: > 2011/2/10 Michal Nazarewicz <mina86@xxxxxxxxxx>: >> On Thu, 10 Feb 2011 12:37:25 +0100, ratheesh k <ratheesh.ksz@xxxxxxxxx> >> 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: mnazarewicz@xxxxxxxxxx>--------ooO--(_)--Ooo-- >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html