[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multi-threaded Emacs
From: |
Chetan Pandya |
Subject: |
Re: multi-threaded Emacs |
Date: |
Sun, 7 Dec 2008 19:06:39 -0800 (PST) |
I am wondering if there is eally an expectation build a multi-threading emacs.
There are also all of the global variables in C code that might need to be
saved and restored e.g. while loading a file.
Chetan
--- On Sun, 12/7/08, Giuseppe Scrivano <address@hidden> wrote:
> From: Giuseppe Scrivano <address@hidden>
> Subject: Re: multi-threaded Emacs
> To: "Stefan Monnier" <address@hidden>
> Cc: address@hidden, address@hidden
> Date: Sunday, December 7, 2008, 11:51 PM
> Stefan Monnier <address@hidden> writes:
>
> >
> > 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.
>
> It is exactly what I do in save_thread_bindings () and
> restore_thread_bindings ().
>
> Trying your code (plus initializing the thread and another
> ')' at the
> end) I have:
>
> (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)))))
>
> "hello"
>
> "world"
>
> "hello"
>
> "world"
>
>
> Regards,
> Giuseppe
- Re: multi-threaded Emacs, (continued)
- 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, 2008/12/07
- Re: multi-threaded Emacs, Giuseppe Scrivano, 2008/12/07
- Re: multi-threaded Emacs,
Chetan Pandya <=
- 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
- Re: multi-threaded Emacs, dhruva, 2008/12/08
- Re: multi-threaded Emacs, Andreas Schwab, 2008/12/09