From owner-freebsd-current Thu Jul 1 15:30:16 1999 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id B4A7414D63 for ; Thu, 1 Jul 1999 15:30:13 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id PAA50452; Thu, 1 Jul 1999 15:30:12 -0700 (PDT) (envelope-from dillon) Date: Thu, 1 Jul 1999 15:30:12 -0700 (PDT) From: Matthew Dillon Message-Id: <199907012230.PAA50452@apollo.backplane.com> To: Julian Elischer Cc: current@FreeBSD.ORG Subject: Re: Rfork man page entry & reality. References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Yes, you are absolutely right. It should also say: rfork() cannot be directly called from C when used with RFMEM, because C cannot deal with the fact that both processes return to the same stack. ( As an aside, we really need a linunx clone()-like system call so we can make use of this very cool rfork() threading feature. I wrote some example code a few months ago which someone can dig up for the core if they want to do it. If we can simply duplicate the linux clone from the compat libs it would be very cool if it were made available in our standard libs ). -Matt Matthew Dillon :The Rfork man page says: : RFMEM If set, the kernel will force sharing of the entire ad- : dress space. The child will then inherit all the shared : segments the parent process owns. Other segment types : will be unaffected. Subsequent forks by the parent will : then propagate the shared data and bss between children. : The stack segment is always split. May be set only with : RFPROC. : :However the code says: : : if (flags & RFMEM) { : p2->p_vmspace = p1->p_vmspace; : p1->p_vmspace->vm_refcnt++; : } : : :My guess is that the man page should be changed to say: : : RFMEM If set, the kernel will force sharing of the entire ad- : dress space. The child will then inherit all the memory : segments the parent process owns. This is the basis of some : thread models. May be set only with RFPROC. : :Any better suggestions of wording will be apreciated.. :I'll check in a change of whatever sounds best :after a day or so.. : :julian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message