From owner-freebsd-hackers Thu Jan 30 19:39:13 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id TAA27494 for hackers-outgoing; Thu, 30 Jan 1997 19:39:13 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id TAA27489 for ; Thu, 30 Jan 1997 19:39:10 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id UAA01418; Thu, 30 Jan 1997 20:37:34 -0700 From: Terry Lambert Message-Id: <199701310337.UAA01418@phaeton.artisoft.com> Subject: Re: Re(2): Using rfork() / threads To: Andrew.Gordon@net-tel.co.uk Date: Thu, 30 Jan 1997 20:37:34 -0700 (MST) Cc: rminnich@Sarnoff.COM, freebsd-hackers@FreeBSD.org In-Reply-To: <"40b1-970131030103-8AD9*/G=Andrew/S=Gordon/O=NET-TEL Computer from "Andrew.Gordon@net-tel.co.uk" at Jan 31, 97 03:01:17 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > > VM space handling is a little different. If you request VM space sharing, > > you don't exactly get Vm address space sharing: what you get is instead > > shared data areas where in normal fork they are copied. More details on > > request. The effect is what you want, though: shared data areas. > > What synchronization primitives are you supposed to use between two > rfork()ed processes? Using SysV sepmaphores seems a bit perverse > (and would they even work in the environment after a rfork() ?), > but talking through pairs of sockets to lock small datastructures > seems a bit heavyweight. You use processor test-and-set (CMPTST) on a shared region. If you want SMP cache coherency for the same situation, you write a kernel module that uses IPI invalidation queueing. Time for a set of mutex libraries that are SMP aware? It would be easier in elf so you could constructorize the mutex initialization to decide whether or not to make kernel or non-kernel calls at load time. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.