| I think I may have found another possible bug in Arc that relates to the interaction of ccc with threading. What happens when you invoke a continuation created by a thread that is already dead? For instance: arc> (= thr (do (= x nil) (thread (do (ccc (fn (c) (= x c))) (prn "alive") (sleep 5) (prn "dead")))))
#<thread: thr>
arc> alive
(dead thr)
nil
;; five seconds later
arc> dead
(dead thr)
t
arc> (x 1)
alive
> (dead thr)
reference to undefined identifier: dead
=== context ===
/usr/local/racket/lib/racket/collects/racket/private/misc.rkt:85:7
>
I suppose something odd is happening here to say the least. I also wonder what would happen in general if a continuation is invoked from a different thread than the one that created it. Trying to do the same thing in Arc 3.1, by extending the sleep time in the thread above to say, 300 seconds, and then invoking the continuation before the timeout, again drops me into a Racket prompt, after printing 'alive' and 'dead' twice.What do you guys suppose should be the proper behavior in this case? I am for the moment disallowing the invocation of continuations from any thread except the one that created them in Arcueid, but I would also like to hear other opinions on what to do in this case. For instance, what does Racket do when faced with the same situation of continuations escaping from their threads? |