From owner-cvs-all Fri Feb 2 14:36:47 2001 Delivered-To: cvs-all@freebsd.org Received: from blizzard.sabbo.net (unknown [193.193.218.18]) by hub.freebsd.org (Postfix) with ESMTP id E204437B401; Fri, 2 Feb 2001 14:36:14 -0800 (PST) Received: from vic.sabbo.net (root@vic.sabbo.net [193.193.218.112]) by blizzard.sabbo.net (8.10.1/8.10.1) with ESMTP id f12Ma7815571; Sat, 3 Feb 2001 00:36:09 +0200 Received: (from max@localhost) by vic.sabbo.net (8.11.2/8.9.3) id f12Ma7N17166; Sat, 3 Feb 2001 00:36:07 +0200 (EET) (envelope-from sobomax@FreeBSD.org) From: Maxim Sobolev Message-Id: <200102022236.f12Ma7N17166@vic.sabbo.net> Subject: Re: mdconfig config file (was: cvs commit: src/sys/i386/conf GENERI C) To: dillon@earth.backplane.com (Matt Dillon) Date: Sat, 3 Feb 2001 00:36:07 +0200 (EET) Cc: sobomax@FreeBSD.ORG (Maxim Sobolev), dima@unixfreak.org (Dima Dorfman), mi@aldan.algebra.com, deischen@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG In-Reply-To: <200102022218.f12MIV700601@earth.backplane.com> from "Matt Dillon" at Feb 02, 2001 02:18:31 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > : > :> > :> > :> if ((pid = fork()) == 0) { > : > :Probably vfork() is better here, no? > : > :-Maxim > > My rule for using vfork() is: Does it improve performance in > a noticeable way? The answer, at least for mount_*, is no. If the > answer is no, you should simply use a normal fork(). > > fork() under FreeBSD is not all that expensive. vfork() will be faster, > but unless you are fork/exec'ing a few dozen commands a second you will > never notice the difference. Well, I'm using a slightly different rule: Does it really need a full fork() to work correctly. The answer in this case is obviously no. Therefore vfork() could (and should IMO) be used instead. While it obviously wouldn't make any difference from the performance standpoind, but it's better from the ideological standpoint (for example one can cut'n'paste this handy code into his own program w/o taking into consideration fork() vs. vfork() issue). -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message