From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.user Subject: Re: Resizing hash tables in Guile Date: 12 Feb 2003 12:41:24 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: <87lm0o7951.fsf@alice.rotty.yi.org> <1044889242.1033.310.camel@localhost> <1044984847.1032.419.camel@localhost> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045051685 32613 80.91.224.249 (12 Feb 2003 12:08:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 12 Feb 2003 12:08:05 +0000 (UTC) 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 18ivgD-0008TJ-00 for ; Wed, 12 Feb 2003 13:08:04 +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 18ivbK-0001gJ-04 for guile-user@m.gmane.org; Wed, 12 Feb 2003 07:02:54 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18ivGp-0008Dw-00 for guile-user@gnu.org; Wed, 12 Feb 2003 06:41:43 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18ivGc-00084N-00 for guile-user@gnu.org; Wed, 12 Feb 2003 06:41:31 -0500 Original-Received: from krusty.dt.e-technik.uni-dortmund.de ([129.217.163.1] helo=mail.dt.e-technik.uni-dortmund.de) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ivGc-0007yp-00 for guile-user@gnu.org; Wed, 12 Feb 2003 06:41:30 -0500 Original-Received: from burns.dt.e-technik.uni-dortmund.de (burns.dt.e-technik.uni-dortmund.de [129.217.163.19])A9810A381D for ; Wed, 12 Feb 2003 12:41:25 +0100 (CET) Original-Received: by burns.dt.e-technik.uni-dortmund.de (Postfix, from userid 520) id 844024108E; Wed, 12 Feb 2003 12:41:25 +0100 (CET) Original-To: guile-user@gnu.org In-Reply-To: <1044984847.1032.419.camel@localhost> Original-Lines: 31 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1636 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1636 Roland Orre writes: > > 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? Since users must consciously ask for resizable hash tables, we can require them to do the locking themselves. Should we? I would say yes, since people need to be aware of thread issues anyway, and maybe they have a better scheme for ensuring thread safe access to a hash table. Removing the locking from the core code should improve performance, right? However, the hash tables should be somewhat thread safe: they might not work as advertised when multiple threads access them, but the application might not crash. That is, adding an element from one thread while another thread is doing the same thing might make one of the elements disappear, but it must leave the hash table in a valid state. Do the non-resizing hash tables behgave that way, incidentally? (Ahh, I just love cooperative threading. These things are so much easier and efficient when there is only one running thread with defined switch points... :-) _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user