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:03:33 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87ad4ikw16.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> <40022F15.30903@vzavenue.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074651670 23450 80.91.224.253 (21 Jan 2004 02:21:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2004 02:21:10 +0000 (UTC) Cc: Bill Schottstaedt , Carl Witty , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jan 21 03:21:04 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 1Aj7zM-00070v-00 for ; Wed, 21 Jan 2004 03:21:04 +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 1Aj5s6-0005OV-8p for guile-devel@m.gmane.org; Tue, 20 Jan 2004 19:05:26 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aj5qw-0005HG-Ms for guile-devel@gnu.org; Tue, 20 Jan 2004 19:04:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aj5qL-0005BZ-5X for guile-devel@gnu.org; Tue, 20 Jan 2004 19:04:08 -0500 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aj5qK-0005BL-Fi for guile-devel@gnu.org; Tue, 20 Jan 2004 19:03:36 -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 1Aj5r7-0001nv-00 for guile-devel@gnu.org; Wed, 21 Jan 2004 01:04:26 +0100 Original-Received: (qmail 26918 invoked by uid 1000); 21 Jan 2004 00:03:33 -0000 Original-To: Richard Todd In-Reply-To: <40022F15.30903@vzavenue.net> (Richard Todd's message of "Sun, 11 Jan 2004 23:22:29 -0600") 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:3259 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3259 Richard Todd writes: > 1) If you are worried about thread safety, the most fool-proof C > interface probably does not allow separate access to numerator and > denominator, since they need to be read in one atomic operation to > ensure consistent results in the face of other mutating code. Guile fractions can not mutated in general: they always represent one value. The mutation that might take place is a reduction, but that might only happen once. After a fraction is reduced, it stays that way. So when you have a reduced fraction you can safely return the nominator, say, without having to worry that a later access to the denominator will return something bogus. -- 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