[trivial-timeout-devel] clozure cl doesn't recognize dynamic variables
Hi, Using `with-timeout' with Clozure-CL results in the following bug, in which the dynamic value of special variables are not recognized inside of the `with-timeout' macro. #+begin_src common-lisp (defvar *echo* :default) (let ((*echo* :special)) (format t "~&outside echo:~a" *echo*) ;; => outside echo:SPECIAL (with-timeout (1) (format nil "~&inside echo:~a" *echo*))) ;; => "inside echo:DEFAULT" #+end_src Best -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/
Code enclosed with WITH-TIMEOUT on CCL runs in separate thread and this behavior is correct and documented (regarding threads and dynamic environment), SBCL threads and dynamic environment works the same but WITH-TIMEOUT on SBCL is implemented on top of SBCL timers. This is probably bug in trivial-timeout context but i don't think that there is easy&good solution here ... Milan On Apr 7, 2011, at 7:10 PM, Eric Schulte wrote:
Hi,
Using `with-timeout' with Clozure-CL results in the following bug, in which the dynamic value of special variables are not recognized inside of the `with-timeout' macro.
#+begin_src common-lisp (defvar *echo* :default)
(let ((*echo* :special)) (format t "~&outside echo:~a" *echo*) ;; => outside echo:SPECIAL (with-timeout (1) (format nil "~&inside echo:~a" *echo*))) ;; => "inside echo:DEFAULT" #+end_src
Best -- Eric
-- Eric Schulte http://cs.unm.edu/~eschulte/
_______________________________________________ trivial-timeout-devel mailing list trivial-timeout-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/trivial-timeout-devel
Milan Jovanovic <milanj@gmail.com> writes:
Code enclosed with WITH-TIMEOUT on CCL runs in separate thread and this behavior is correct and documented (regarding threads and dynamic environment), SBCL threads and dynamic environment works the same but WITH-TIMEOUT on SBCL is implemented on top of SBCL timers. This is probably bug in trivial-timeout context but i don't think that there is easy&good solution here ...
Thanks for the explanation, that all makes sense, luckily there is an easy enough workaround... #+begin_src lisp (let ((new-value *echo*)) (with-timeout (1) ... new-value ...)) #+end_src -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/
Hi Eric, I'll try to add a note to the manual about this. the whole idea of timeouts is problematic as multithreading becomes the norm. From my iPhone to you… On Apr 7, 2011, at 3:07 PM, "Eric Schulte" <schulte.eric@gmail.com> wrote:
Milan Jovanovic <milanj@gmail.com> writes:
Code enclosed with WITH-TIMEOUT on CCL runs in separate thread and this behavior is correct and documented (regarding threads and dynamic environment), SBCL threads and dynamic environment works the same but WITH-TIMEOUT on SBCL is implemented on top of SBCL timers. This is probably bug in trivial-timeout context but i don't think that there is easy&good solution here ...
Thanks for the explanation, that all makes sense, luckily there is an easy enough workaround...
#+begin_src lisp (let ((new-value *echo*)) (with-timeout (1) ... new-value ...)) #+end_src
-- Eric
-- Eric Schulte http://cs.unm.edu/~eschulte/
_______________________________________________ trivial-timeout-devel mailing list trivial-timeout-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/trivial-timeout-devel
participants (3)
-
Eric Schulte
-
Gary King
-
Milan Jovanovic