From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_i_fraction_reduce thread safety Date: Wed, 21 Jan 2004 01:00:33 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87ektukw66.fsf@zagadka.ping.de> References: <3FD85844.3060108@ccrma> <1071170342.1217.60.camel@flare> <87wu91mxhf.fsf@zip.com.au> <87k73z1la9.fsf@zagadka.ping.de> <87ad4ve61r.fsf@zip.com.au> <87hdz3xocn.fsf@zagadka.ping.de> <87zncuat0g.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074653942 27953 80.91.224.253 (21 Jan 2004 02:59:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2004 02:59:02 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jan 21 03:58:55 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aj8Zz-0008Vg-00 for ; Wed, 21 Jan 2004 03:58:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aj8X4-0002uf-Rv for guile-devel@m.gmane.org; Tue, 20 Jan 2004 21:55:54 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aj6bO-0003ey-HY for guile-devel@gnu.org; Tue, 20 Jan 2004 19:52:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aj6ap-0003Ww-Un for guile-devel@gnu.org; Tue, 20 Jan 2004 19:52:12 -0500 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aj5nP-0004wQ-89 for guile-devel@gnu.org; Tue, 20 Jan 2004 19:00:35 -0500 Original-Received: from dialin.speedway42.dip148.dokom.de ([195.138.42.148] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 1Aj5oC-0001ZD-00 for guile-devel@gnu.org; Wed, 21 Jan 2004 01:01:25 +0100 Original-Received: (qmail 26915 invoked by uid 1000); 21 Jan 2004 00:00:33 -0000 Original-To: guile-devel@gnu.org In-Reply-To: <87zncuat0g.fsf@zip.com.au> (Kevin Ryde's message of "Mon, 12 Jan 2004 10:51:43 +1000") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3262 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3262 Kevin Ryde writes: > Marius Vollmer writes: >> >> User code should only use scm_numerator and scm_denominator to access >> parts of the fraction object and those functions will first reduce the >> fraction (in a thread safe way). Wouldn't that be enough? > > Yep, though it seems a shame the accessors have to be slowed down just > so printing and equality can write back. Is that slow down significant? The logic could be like if fraction is not reduced: lock if fraction is not reduced: reduce it unlock read it So in the common case of a reduced fraction, no locks would be necessary. (This works since a fraction can never go from reduced to unreduced.) -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel