From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Roland Orre Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Resizing hash tables in Guile Date: 11 Feb 2003 18:34:07 +0100 Organization: Royal Institute of Technology Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <1044984847.1032.419.camel@localhost> References: <1044889242.1033.310.camel@localhost> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1044985027 30712 80.91.224.249 (11 Feb 2003 17:37:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 11 Feb 2003 17:37:07 +0000 (UTC) Cc: Greg Troxel Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ieL7-0007yp-00 for ; Tue, 11 Feb 2003 18:37:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ieLv-0000Ev-08 for guile-devel@m.gmane.org; Tue, 11 Feb 2003 12:37:51 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18ieLW-00006C-00 for guile-devel@gnu.org; Tue, 11 Feb 2003 12:37:26 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18ieLH-0008Jb-00 for guile-devel@gnu.org; Tue, 11 Feb 2003 12:37:12 -0500 Original-Received: from smtp0.nada.kth.se ([130.237.222.202] helo=smtp.nada.kth.se) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ieIm-00077F-00; Tue, 11 Feb 2003 12:34:36 -0500 X-Authentication-Info: Sender authentication was Original-Received: from [192.168.1.92] (bari.bacon.su.se [130.237.152.231]) (authenticated bits=0) by smtp.nada.kth.se (8.12.1/8.12.1) with ESMTP id h1BHY4wV024902 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 11 Feb 2003 18:34:17 +0100 (MET) Original-To: djurfeldt@nada.kth.se In-Reply-To: X-Mailer: Ximian Evolution 1.2.1 Original-cc: guile-user@gnu.org Original-cc: Joris van der Hoeven Original-cc: guile-devel@gnu.org Original-cc: Andreas Rottmann Original-cc: mvo@zagadka.de X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:1909 gmane.lisp.guile.user:1634 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1634 On Tue, 2003-02-11 at 14:59, Mikael Djurfeldt wrote: > I've just committed resizing hash table functionality to the Guile > core hashtable functions (in hashtab.c). > > Currently, the only thing which has changed in the API is that the > size argument to the hash table constructors is now optional. If > omitted, you get a resizing table. > > Please comment on this API and also take a look at the implementation > in hashtab.c. I've studied the code and consider this a perfect minimalistic solution. It works without disturbing any old code. I'll test drive the code tonight. > Questions: > > Is this a good thing? Should we keep it? It's definitely a good thing. In our application we sometimes need just a few tens of items hashed but often many millions of items without really knowing beforehand. It's definitely a good thing to not need to bother about analyzing optimal table sizes any longer. We hope it will stay and we will start using it in our application as soon as possible. > I made the hash tables thread-safe (locking/unlocking a mutex at hash > table access and rehashing). Is that good? An alternativ is to > require of the programmer to make sure the hash tables aren't accessed > in parallel. In our case I think we will most likely set up the different processes to use different hash tables but we have still not parallellized our applications. Could/should the mutex protection maybe be optional? Best regards Roland _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel