From owner-freebsd-net Sat May 18 16:22:56 2002 Delivered-To: freebsd-net@freebsd.org Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by hub.freebsd.org (Postfix) with ESMTP id 9661D37B409 for ; Sat, 18 May 2002 16:22:47 -0700 (PDT) Received: (qmail 11331 invoked from network); 18 May 2002 23:22:43 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 18 May 2002 23:22:43 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g4INLxF83616; Sat, 18 May 2002 19:21:59 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3CE6DD8C.FC95386F@mindspring.com> Date: Sat, 18 May 2002 19:21:48 -0400 (EDT) From: John Baldwin To: Terry Lambert Subject: Re: new zero copy sockets patches available Cc: Alfred Perlstein , "Kenneth D. Merry" , current@FreeBSD.org, net@FreeBSD.org Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 18-May-2002 Terry Lambert wrote: > John Baldwin wrote: >> > God, it's annoying that a statically declared mutex is not >> > defacto initialized. >> >> Is it in solaris? > > It isn't in FreeBSD because of the need to link mutex'es into > the "witness protection program". 8-). Actually, there is more to it than that. Or at least, there will be when turnstiles are added (turnstiles require some function callouts to work properly). > MUTEX_DECLARE(mutex_name). Umm, yes, like MTX_SYSINIT(). :) > You could do this with a SYSINIT(), as has been suggested, but > that would add a relatively large per mutex overhead for each > one you want to declare, since you'd basically be repeating the > common components for doing the job for each and every mutex, > instead of sharing them. Umm, this is a boot-up thing so it's not that big of a deal, plus the actual code isn't duplicated, we call a common function for the actual mutex initialization. > Technically, some later programmer could come along and recover > the linker set memory, actually, since it's only used once, for > the traversal, at kernel startup. Erm, they could do the same with the little mtx_args structs if they want to as well, but I think it's more effor than its worth. > -- Terry -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message