[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scm_i_fraction_reduce thread safety
From: |
Marius Vollmer |
Subject: |
Re: scm_i_fraction_reduce thread safety |
Date: |
Wed, 21 Jan 2004 01:00:33 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Kevin Ryde <address@hidden> writes:
> Marius Vollmer <address@hidden> 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
- Re: scm_i_fraction_reduce thread safety, Marius Vollmer, 2004/01/10
- Re: scm_i_fraction_reduce thread safety, Kevin Ryde, 2004/01/10
- Re: scm_i_fraction_reduce thread safety, Marius Vollmer, 2004/01/10
- Re: scm_i_fraction_reduce thread safety,
Marius Vollmer <=
- Re: scm_i_fraction_reduce thread safety, Carl Witty, 2004/01/20
- Re: scm_i_fraction_reduce thread safety, Marius Vollmer, 2004/01/21
- Re: scm_i_fraction_reduce thread safety, Dirk Herrmann, 2004/01/27
- Re: scm_i_fraction_reduce thread safety, Rob Browning, 2004/01/27
- Re: scm_i_fraction_reduce thread safety, Marius Vollmer, 2004/01/29
- Re: scm_i_fraction_reduce thread safety, Rob Browning, 2004/01/29
- Re: scm_i_fraction_reduce thread safety, Mikael Djurfeldt, 2004/01/30