[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multi-threaded Emacs
From: |
Stefan Monnier |
Subject: |
Re: multi-threaded Emacs |
Date: |
Sun, 07 Dec 2008 15:51:25 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
>>> Each thread should have its own local bindings. To do this
>>> requires swapping bindings in and out of the specpdls
>>> when switching threads. It is not hard.
[...]
> Actually I am using what Richard suggested. Every thread has a specpdl
> and on a thread switch I copy the current symbol value inside its
> specbinding cell.
Switching the value of specpdl is not enough. Try
(progn
(run-in-thread a-thread '(dotimes (i 2)
(print "hello")
(yield)))
(let ((i 5))
(while (< i 7)
(print "world")
(yield)
(setq i (1+ i))))
What Richard suggests is that upon a thread-switch we walk up the specpdl
stack, undoing all the bindings, then switch specpdl to the one of the
other thread and walk down that one to reestablish the local bindings of
the new thread.
Stefan
- Re: multi-threaded Emacs, (continued)
- Re: multi-threaded Emacs, Ted Zlatanov, 2008/12/05
- Re: multi-threaded Emacs, Tom Tromey, 2008/12/05
- Re: multi-threaded Emacs, Miles Bader, 2008/12/05
- Re: multi-threaded Emacs, Helmut Eller, 2008/12/06
- Re: multi-threaded Emacs, Stefan Monnier, 2008/12/06
- Re: multi-threaded Emacs, Richard M Stallman, 2008/12/06
- Re: multi-threaded Emacs, Stefan Monnier, 2008/12/05
- Re: multi-threaded Emacs, Richard M Stallman, 2008/12/06
- Re: multi-threaded Emacs, Stefan Monnier, 2008/12/06
- Re: multi-threaded Emacs, Giuseppe Scrivano, 2008/12/06
- Re: multi-threaded Emacs,
Stefan Monnier <=
- Re: multi-threaded Emacs, Giuseppe Scrivano, 2008/12/07
- Re: multi-threaded Emacs, Chetan Pandya, 2008/12/07
- Re: multi-threaded Emacs, Stefan Monnier, 2008/12/08
- Re: multi-threaded Emacs, Richard M Stallman, 2008/12/07
- Re: multi-threaded Emacs, Stefan Monnier, 2008/12/07
- Re: multi-threaded Emacs, Giuseppe Scrivano, 2008/12/07
- Re: multi-threaded Emacs, Richard M Stallman, 2008/12/08
- Re: multi-threaded Emacs, Giuseppe Scrivano, 2008/12/08
- Re: multi-threaded Emacs, dhruva, 2008/12/08
- Re: multi-threaded Emacs, Stephen J. Turnbull, 2008/12/08