From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Christopher Cramer Newsgroups: gmane.lisp.guile.devel Subject: Re: [pthreads] performance test using fib.scm Date: Wed, 11 Dec 2002 14:05:43 -0600 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <20021211140543.A21053@kiwi.pyrotechnics.com> References: <20021210211010.GB355@gmx.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1039642584 13398 80.91.224.249 (11 Dec 2002 21:36:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2002 21:36:24 +0000 (UTC) Cc: guile-devel@gnu.org 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 18MEWk-0003Tj-00 for ; Wed, 11 Dec 2002 22:36:22 +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 18MEBK-0008IA-05 for guile-devel@m.gmane.org; Wed, 11 Dec 2002 16:14:14 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18MEAx-0008Gy-00 for guile-devel@gnu.org; Wed, 11 Dec 2002 16:13:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18MEAv-0008GY-00 for guile-devel@gnu.org; Wed, 11 Dec 2002 16:13:50 -0500 Original-Received: from pyro.net ([207.7.10.6] helo=kiwi.pyro.net) by monty-python.gnu.org with smtp (Exim 4.10.13) id 18MDV9-0001m9-00 for guile-devel@gnu.org; Wed, 11 Dec 2002 15:30:40 -0500 Original-Received: (qmail 24020 invoked by uid 8610); 11 Dec 2002 20:05:43 -0000 Original-To: Mikael Djurfeldt Mail-Followup-To: Mikael Djurfeldt , Wolfgang Jaehrling , guile-devel@gnu.org Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from djurfeldt@nada.kth.se on Tue, Dec 10, 2002 at 09:10:37PM +0100 Original-cc: Wolfgang Jaehrling 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:1821 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1821 On Tue, Dec 10, 2002 at 09:10:37PM +0100, Mikael Djurfeldt wrote: > Wolfgang Jaehrling writes: > > > malloc() in glibc is thread-save, but not reentrant. Since the > > behaviour of realloc() is unlikely to differ from malloc() in this > > respect, you most certainly have to protect calls to it with a lock. > > 2002-12-10 Mikael Djurfeldt > > * gc-malloc.c (malloc_mutex): New mutex. > (scm_gc_init_malloc): Initialize it. > (scm_realloc): Serialize call to realloc > (scm_calloc): Same for calloc. > Thanks to Wolfgang Jaehrling! > (Now we have to make sure all calls to malloc/realloc are made > through scm_malloc.) Every pthreads implementation is required to have a thread-safe malloc, calloc, realloc and free (along with many other functions). The fact that malloc etc. are non-reentrant only means that you shouldn't call them from a signal handler. Any pthreads implementation that requires you to lock a mutex to call malloc is broken. -- Christopher Cramer "Gore would have finished ahead by the barest of margins had he pursued and gained a complete statewide recount." -- Associated Press, 9/6/2002 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel