Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2002 19:21:48 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Alfred Perlstein <bright@mu.org>, "Kenneth D. Merry" <ken@kdm.org>, current@FreeBSD.org, net@FreeBSD.org
Subject:   Re: new zero copy sockets patches available
Message-ID:  <XFMail.20020518192148.jhb@FreeBSD.org>
In-Reply-To: <3CE6DD8C.FC95386F@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org>  <><  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-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020518192148.jhb>