linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Isom <jeisom@gmail.com>
To: ratheesh k <ratheesh.ksz@gmail.com>
Cc: Michal Nazarewicz <mina86@mina86.com>,
	linux-c-programming@vger.kernel.org
Subject: Re: same pid ?
Date: Thu, 10 Feb 2011 17:26:46 -0600	[thread overview]
Message-ID: <AANLkTin7D6yHCVGVVie0jY7o68FC+pkFAk2XWvHwFZz+@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikuVajDt1PmQgk=97jk-+8Aei=yg4HCrjJP9JHc@mail.gmail.com>

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

  reply	other threads:[~2011-02-10 23:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTincdyMFR2Yb-HVvKmqoVTyTvSXweM5K_WLzFijC@mail.gmail.com>
2011-02-10 11:37 ` same pid ? ratheesh k
2011-02-10 12:22   ` Michal Nazarewicz
2011-02-10 18:09     ` ratheesh k
2011-02-10 23:26       ` Jonathan Isom [this message]
2011-02-11  2:18         ` ratheesh k
2011-02-11  5:12           ` Steve Graegert (スティーブ)
2011-02-11  7:19             ` ratheesh k
2011-02-11  9:02               ` ratheesh k

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTin7D6yHCVGVVie0jY7o68FC+pkFAk2XWvHwFZz+@mail.gmail.com \
    --to=jeisom@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=mina86@mina86.com \
    --cc=ratheesh.ksz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).