public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Tachino Nobuhiro <tachino@open.nm.fujitsu.co.jp>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [BUG 2.4.6] PPID of a process is set to itself
Date: 17 Jul 2001 00:08:27 -0700	[thread overview]
Message-ID: <m3ae24m3ro.fsf@otr.mynet> (raw)
In-Reply-To: <Pine.LNX.4.33.0107162325120.933-100000@penguin.transmeta.com>
In-Reply-To: Linus Torvalds's message of "Mon, 16 Jul 2001 23:40:02 -0700 (PDT)"

Linus Torvalds <torvalds@transmeta.com> writes:

> 	if (!has_created_master_process) {
> 		new_me = clone(CLONE_VM | SIGCHLD);
> 		if (new_me > 0) {
> 			/* Original thread turns into master process */
> 			printf("I am the new master process, bow down before me!\n");
> 			has_created_master_process = 1;
> 			for (;;) {
> 				if (!waitpid(-1, NULL, 0))
> 					continue;
> 				if (errno == ENOCHLD)
> 					exit(0);
> 				.. we could do signal propagation here ..
> 			}
> 		}
> 		/* This child now takes over the role of the original thread */

A bit more complicated due to switching of stacks but that's basically
it.  With this clone model using n+1 threads is the only way to get
the semantics right.

> Also, please do notice that one fundamental part of the CLONE_THREAD logic
> never made it into a stable kernel: the shared signal handling. So while
> CLONE_THREAD allows for many pthread-like things (one common process ID
> shared by all threads, for example), the most fundamental part of it was
> not actually merged into the standard kernel because of stability concerns
> in late pre-2.4 test cycle.

Exactly.  This is holding off everything.  The way this is solved
(basically: the limitations imposed on the userland implementation)
will determine much of the implementation.

I've done already a great deal of the implementation when Linus first
put the code in the late 2.3 kernels.  If somebody finally would get
the signal handling stuff done (and a few more little things, some
Linus already agreed on) we could have a compliant pthread
implementation soon.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

  reply	other threads:[~2001-07-17  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-17  4:21 [BUG 2.4.6] PPID of a process is set to itself Tachino Nobuhiro
2001-07-17  4:41 ` Linus Torvalds
2001-07-17  6:10   ` Tachino Nobuhiro
2001-07-17  6:40     ` Linus Torvalds
2001-07-17  7:08       ` Ulrich Drepper [this message]
2001-07-17 23:13         ` huge number of context switches under 2.2.x with SMP & threaded apps bert hubert
2001-07-17 23:29           ` huge number of context switches under 2.2.x with SMP & threa Davide Libenzi

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=m3ae24m3ro.fsf@otr.mynet \
    --to=drepper@redhat.com \
    --cc=drepper@cygnus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tachino@open.nm.fujitsu.co.jp \
    --cc=torvalds@transmeta.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