Subject: Re: Why no /usr/include/sys/kthread.h?
To: Matthew Orgass <>
From: Jason R Thorpe <>
List: tech-kern
Date: 06/05/2000 16:38:48
On Mon, Jun 05, 2000 at 07:18:09PM -0400, Matthew Orgass wrote:

 >   I hope this makes it in 1.5.  I think it would be a good idea to also
 > implement rfork, though. The non-RFPROC case could be used to detatch a
 > thread's descriptors after a clone or rfork and the RFPROC case (also as
 > sfork, which is the share everything possible equivalent of fork) is
 > rather convenient for direct use in some situations where you do not
 > really need a thread library and would otherwise just use fork.

I have a hard time calling something rfork(2) if it doens't work like the
original rfork(2) (as seen in Plan 9).  IMO, the FreeBSD people choose a
poor name for thier __clone()-like system call.

 >   It would also be nice to have the MAP_STACK mmap flag as in FreeBSD (but
 > specify that the created stack always goes the right direction), though
 > that would probably be more work.

I see little value in MAP_STACK.  The reference model for threads (Solaris)
doesn't need it.  I don't see why we should.  If you want it to avoid pre-
allocating swap space for stack pages, then again we can follow Solaris's
lead and implement MAP_NORESERVE.

        -- Jason R. Thorpe <>