guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scm_i_fraction_reduce thread safety


From: Kevin Ryde
Subject: scm_i_fraction_reduce thread safety
Date: Wed, 10 Dec 2003 06:39:36 +1000
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

There's a comment in scm_i_fraction_reduce questioning the safety of
modifying the given fraction.

I think it probably isn't safe, if other threads are looking at the
fraction concurrently, and also I suspect two threads running that
reduce function itself would not be safe.

Not sure what to do about it.  I guess the choices would be between
some sort of lock, not storing back reduced values, or keeping
fractions reduced always.

Reducing every so often might be a good idea, since rational
arithmetic is a bit notorious for intermediate expression swell.
Maybe gc could do something.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]