From owner-freebsd-arch@FreeBSD.ORG Mon May 5 20:32:52 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CCFFA37B42A for ; Mon, 5 May 2003 20:32:51 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34D1C43F75 for ; Mon, 5 May 2003 20:32:51 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0018.cvx21-bradley.dialup.earthlink.net ([209.179.192.18] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19CtCA-0005aZ-00; Mon, 05 May 2003 20:32:47 -0700 Message-ID: <3EB72C95.6E9EEA50@mindspring.com> Date: Mon, 05 May 2003 20:31:33 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Igor Sysoev References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4e7a3804c4321f93ff2d78645e0d3f35793caf27dac41a8fd350badd9bab72f9c350badd9bab72f9c cc: freebsd-arch@freebsd.org Subject: Re: rfork(RFPROC|RFMEM) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2003 03:32:53 -0000 Igor Sysoev wrote: > On Mon, 5 May 2003, Terry Lambert wrote: > What is stack glue ? See the code in fork1() in /sys/kern/kern_fork.c. > I use rfork_thread(3) wrapper that allows to setup another stack for > rfork()ed process. > > What RFTHREAD flag does ? See the code. It basically sets up for kernel threading, rather than merely for processes sharing the same address space and/or file descriptor table and/or heap, which is what rfork was intended to be able to do. It also ensures propagation of any SIGKILL to all peers, so they die all at once, in exit1() in /sys/kern/kern_exit.c. > By the way linuxthreads port always uses RFTHREAD flag. They don't know any other way than the moral equivalent of the Linux "clone" system call, so that's what they use; it's technically not necessary. See also the source code in the directory /usr/src/lib/libpthread, which doesn't use rfork() at all. -- Terry