unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chetan Pandya <pandyacus@sbcglobal.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Giuseppe Scrivano <gscrivano@gnu.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: multi-threaded Emacs
Date: Sun, 7 Dec 2008 19:06:39 -0800 (PST)	[thread overview]
Message-ID: <97213.26712.qm@web83202.mail.mud.yahoo.com> (raw)
In-Reply-To: <87y6yrtuhj.fsf@master.homenet>

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 <gscrivano@gnu.org> wrote:

> From: Giuseppe Scrivano <gscrivano@gnu.org>
> Subject: Re: multi-threaded Emacs
> To: "Stefan Monnier" <monnier@iro.umontreal.ca>
> Cc: rms@gnu.org, emacs-devel@gnu.org
> Date: Sunday, December 7, 2008, 11:51 PM
> Stefan Monnier <monnier@iro.umontreal.ca> 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




  reply	other threads:[~2008-12-08  3:06 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-29 13:32 multi-threaded Emacs Giuseppe Scrivano
2008-11-29 20:26 ` Stefan Monnier
2008-11-29 21:01   ` Giuseppe Scrivano
2008-11-29 22:21     ` Stefan Monnier
2008-11-30 11:35       ` Giuseppe Scrivano
2008-11-30 21:46         ` Stefan Monnier
2008-11-30 22:25           ` Giuseppe Scrivano
2008-11-30 23:03             ` Stefan Monnier
2008-11-30 23:30               ` Giuseppe Scrivano
2008-12-01  3:37                 ` Stefan Monnier
2008-12-06 22:50           ` Tom Tromey
2008-12-07  3:31             ` Stefan Monnier
2008-11-29 22:06   ` Tom Tromey
2008-11-30 16:43 ` Richard M Stallman
2008-11-30 17:34   ` Giuseppe Scrivano
2008-11-30 21:51     ` Stefan Monnier
2008-11-30 22:10       ` Giuseppe Scrivano
2008-11-30 22:20     ` Miles Bader
2008-11-30 23:09       ` Stefan Monnier
2008-11-30 23:09       ` Giuseppe Scrivano
2008-12-01  0:10         ` Chetan Pandya
2008-12-01  3:55         ` Stefan Monnier
2008-12-01 14:06     ` Richard M Stallman
2008-12-01 18:57       ` Giuseppe Scrivano
2008-12-01 20:34         ` Stefan Monnier
2008-12-01 22:41           ` joakim
2008-12-02 16:02         ` Richard M Stallman
2008-12-02 22:22           ` Stefan Monnier
2008-12-02 22:41             ` Giuseppe Scrivano
2008-12-03  2:17               ` Stefan Monnier
2008-12-03 18:26                 ` Giuseppe Scrivano
2008-12-03 20:14                   ` Stefan Monnier
2008-12-05  2:59                     ` Richard M Stallman
2008-12-05  7:40                       ` Giuseppe Scrivano
2008-12-05  8:20                         ` Miles Bader
2008-12-05  9:42                           ` Paul R
2008-12-05 10:10                             ` Eli Zaretskii
2008-12-05 10:35                               ` Paul R
2008-12-05 11:02                           ` Helmut Eller
2008-12-05 15:39                             ` Stefan Monnier
2008-12-05 16:22                             ` Ted Zlatanov
2008-12-05 16:57                             ` Tom Tromey
2008-12-06  4:41                               ` Miles Bader
2008-12-06  7:44                               ` Helmut Eller
2008-12-06 22:31                                 ` Stefan Monnier
2008-12-06  8:30                         ` Richard M Stallman
2008-12-05 15:36                       ` Stefan Monnier
2008-12-06 19:25                         ` Richard M Stallman
2008-12-06 22:41                           ` Stefan Monnier
2008-12-06 23:41                             ` Giuseppe Scrivano
2008-12-07 20:51                               ` Stefan Monnier
2008-12-07 23:51                                 ` Giuseppe Scrivano
2008-12-08  3:06                                   ` Chetan Pandya [this message]
2008-12-08 15:50                                   ` Stefan Monnier
2008-12-07 16:02                             ` Richard M Stallman
2008-12-07 20:52                               ` Stefan Monnier
2008-12-07 16:15                           ` Giuseppe Scrivano
2008-12-08 18:26                             ` Richard M Stallman
2008-12-08 19:49                               ` Giuseppe Scrivano
2008-12-09  2:15                                 ` dhruva
2008-12-09  2:49                                   ` Stephen J. Turnbull
2008-12-09  2:53                                     ` dhruva
2008-12-09  9:36                                     ` Andreas Schwab
2008-12-09 17:26                                 ` Richard M Stallman
2008-12-09 19:10                                   ` Giuseppe Scrivano
2008-12-10 18:18                                     ` Richard M Stallman
2008-12-10 18:18                                     ` Richard M Stallman
2008-12-09 19:40                                   ` Stefan Monnier
2008-12-10 18:18                                     ` Richard M Stallman
2008-12-11  1:59                                       ` Stefan Monnier
2008-12-11 14:41                                         ` Ted Zlatanov
2008-12-11 18:30                                           ` Stefan Monnier
2008-12-11 18:42                                             ` Ted Zlatanov
2008-12-11 19:01                                               ` Paul R
2008-12-11 20:53                                               ` Stefan Monnier
2008-12-12 19:03                                                 ` Giuseppe Scrivano
2008-12-13  3:08                                                   ` Stefan Monnier
2008-12-11 19:07                                         ` Paul R
2008-12-11 20:54                                           ` Stefan Monnier
2008-12-05  2:59                   ` Richard M Stallman
2008-12-05 15:40                     ` Stefan Monnier
2008-12-02 23:10             ` Florian Beck
2008-11-30 22:17   ` Miles Bader
2008-11-30 16:44 ` Richard M Stallman
  -- strict thread matches above, loose matches on Subject: below --
2008-12-03  7:59 Re[2]: " ak70
2008-12-04  8:45 ` Richard M Stallman
     [not found]   ` <87prk8mhg9.fsf@vanilla.net.mt>
     [not found]     ` <E1L8ZUB-0002x3-VT@fencepost.gnu.org>
2008-12-05 13:27       ` Li Lin
     [not found]         ` <87prk64ilv.fsf@vanilla.net.mt>
2008-12-05 18:37           ` Giuseppe Scrivano
2008-12-06 21:58             ` Magnus Henoch
2008-12-04 13:21 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97213.26712.qm@web83202.mail.mud.yahoo.com \
    --to=pandyacus@sbcglobal.net \
    --cc=emacs-devel@gnu.org \
    --cc=gscrivano@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).