LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dave McCracken <dmccr@us.ibm.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Provide system call to get task id
Date: Mon, 8 Oct 2001 11:17:09 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.33.0110081110130.8212-100000@penguin.transmeta.com> (raw)
In-Reply-To: <E15qeaA-0001IU-00@the-village.bc.nu>


On Mon, 8 Oct 2001, Alan Cox wrote:
>
> Would it make more sense to add a getpid() and make the existing one
> gettid() to keep compatibility at its sanest ?

I don't think compatibility is an issue: programs that are (a) threaded
and (b) use the new thread group interface and (c) care about tid simply
do not exist. For the simple reason that they cannot exist - getpid() was
changed at the same time CLONE_THREAD was added.

So the only compatibility worry would be

 - people using non-thread-aware libraries together with a CLONE_THREAD
   core thing - which is possible especially if they have thread wrappers.
   But if those libraries care about "pid/tid" issues, there's no way that
   can have well-defined behaviour anyway ;)

 - people who have been playing with CLONE_THREAD, and have apps that
   depend on the "pid is the 'classical' pid, not the thread ID"
   behaviour. In which case adding a new gettid() is the right thing to
   do.

Now, I actually seriously doubt either of those are real issues, and it
probably doesn't matter what we do. But I'd ratehr have a system call
called "getpid()" do what POSIX threads have traditionally done, namely
give the ID of the process group ("tpid" in linux kernel-speak), and have
"gettid()" give the thread ID ("pid" in linux kernel-speak).

		Linus


  reply	other threads:[~2001-10-08 18:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-08 15:46 Dave McCracken
2001-10-08 15:52 ` Christoph Hellwig
2001-10-08 16:07   ` Alan Cox
2001-10-08 16:05 ` Alan Cox
2001-10-08 17:44   ` Linus Torvalds
2001-10-08 17:52     ` Alan Cox
2001-10-08 18:17       ` Linus Torvalds [this message]
2001-10-08 22:15         ` Miquel van Smoorenburg
2001-10-08 21:53   ` David Woodhouse

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=Pine.LNX.4.33.0110081110130.8212-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dmccr@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] Provide system call to get task id' \
    /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

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).