From owner-freebsd-hackers Mon Jan 29 8:58: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 2B16737B69C for ; Mon, 29 Jan 2001 08:57:45 -0800 (PST) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.1/8.11.1) id f0TGveG33419; Mon, 29 Jan 2001 08:57:40 -0800 (PST) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200101291657.f0TGveG33419@iguana.aciri.org> Subject: Re: [kernel patch] fcntl(...) to close many descriptors In-Reply-To: <4.3.0.20010129151413.023e03a0@pop.free.fr> from mouss at "Jan 29, 2001 3:17:22 pm" To: usebsd@free.fr (mouss) Date: Mon, 29 Jan 2001 08:57:40 -0800 (PST) Cc: rizzo@aciri.org, drosih@rpi.edu, hackers@FreeBSD.ORG, wollman@khavrinen.lcs.mit.edu X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, i have to admit i am not too much into theory of hashing, but i am unclear on how a perfect hash function can be simpler than "the obvious method" when the namespace is changing dynamically because modules are added or deleted. (the obvious method would be a cheap hash on 2-4 chars of the name followed by a scan of the list in each hash slot.) Hopefully the number of functions using this method is small enough not to worry about the depth of the lists, and the type of calls using this method is one where the amt of work in the syscall itself is way larger than the matching cost. cheers luigi > > generic_syscall("fdcloseall", ....); > > > >In this way it would be clear what the non-portable pieces of code > >are, and the mechanism would be extensible with no changes to > >libraries and syscalls. You could even have dynamically-loaded > >modules implementing new "syscalls". > > I see a meachanism like > new_syscall(str, args) = syscall(hash(str), args) > where hash() is chosen to guarantee unicity (that wouldn't be hard to find). > we then have both performance (working with indexes instead of comparing > strings) like what is currently available, and the flexibility of strings. > > Note that this goes in the same dynamic "wind" than loadable modules and > the like: static gets old... > > > cheers, > mouss To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message