[Top][All Lists]

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

futures and error dodginess

From: Kevin Ryde
Subject: futures and error dodginess
Date: Mon, 06 Sep 2004 11:30:35 +1000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)


    (future-ref (future (error "x")))

sometimes gives

    In unknown file:
       ?: 0* [primitive-load "/home/gg/test/future.scm"]
    In /home/gg/test/future.scm:
       2: 1* [future-ref ...
       2: 2*  (future (error "x"))
    In unknown file:
       ?: 3*  [#f]

    /home/gg/test/future.scm:2:13: In procedure apply in expression (future 
(error "x")):
    /home/gg/test/future.scm:2:13: Wrong type argument in position 1: #f

It seems to be a race, sometimes the error is from future-ref about a
failed future (which is good), or sometimes just a segv.

I suspect %threads-handler is its dummy #f when future_handler tries
to call it.  Maybe that definition should be in boot-9 instead of the
threads module.

Adding that module

    (use-modules (ice-9 threads))
    (future-ref (future (error "x")))

then gives a printout

    In thread:
    ERROR: x

but hangs.

reply via email to

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