Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 May 2003 20:31:33 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Igor Sysoev <is@rambler-co.ru>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: rfork(RFPROC|RFMEM)
Message-ID:  <3EB72C95.6E9EEA50@mindspring.com>
References:  <Pine.BSF.4.21.0305051756330.62854-100000@is>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EB72C95.6E9EEA50>